sanitize-4d.css is a CSS library that provides consistent, cross-browser default styling of HTML elements alongside useful defaults.
How to get it
npm install --save @fourdigit/sanitize-4d.css
Usage in npm and webpack
Import sanitize-4d.css in CSS:
Alternatively, import sanitize-4d.css in JS:
webpack.config.js, be sure to use the appropriate loaders:
moduleexports =module:rules:test: /\.css$/use: 'style-loader' 'css-loader'
What does it do?
- Normalizes styles for a wide range of elements.
- Corrects bugs and common browser inconsistencies.
- Provides common, useful defaults.
- Explains what code does using detailed comments.
Box sizing defaults to border-box
Backgrounds do not repeat by default
Pseudo-elements inherit text decoration and vertical alignment
Cursors only change to hint non-obvious interfaces
The default font is the system ui font
Tabs appear the same on the web as in a typical editor
Words break to prevent overflow
Documents do not use a margin for outer padding
Navigation lists do not include a marker style
Pre-formatted and code-formatted text uses the monospace system ui font
Text selections do not include text shadows
Media elements align to the text center of other content
SVGs fallback to the current text color
Tables do not include additional border spacing
Form controls are easily style-able
Textareas only resize vertically by default
Single taps are dispatched immediately on clickable elements
ARIA roles include visual cursor hints
Visually hidden content remains accessible
normalize.css and sanitize-4d.css correct browser bugs while carefully testing and documenting changes. normalize.css styles adhere to css specifications. sanitize-4d.css styles adhere to common developer expectations and preferences. reset.css unstyles all elements. Both sanitize-4d.css and normalize.css are maintained in sync.
- Chrome (last 3)
- Edge (last 3)
- Firefox (last 3)
- Firefox ESR
- Opera (last 3)
- Safari (last 3)
- iOS Safari (last 2)
- Internet Explorer 9+
Please read the contribution guidelines in order to make the contribution process easy and effective for everyone involved.