-
Notifications
You must be signed in to change notification settings - Fork 0
Rules
The most important rule, as far as CSS Lint is concerned, is to ensure there are no parsing errors in the CSS. Parsing errors usually mean you mistyped a character and caused the code to become invalid CSS. These errors may cause the browser to drop a property or an entire rule. Parsing errors are always presented as errors by CSSLint, the most important issues to fix.
The following rules point out potential errors in your CSS.
- Beware of box model size
- Require properties appropriate for display
- Disallow duplicate properties
- Disallow empty rules
- Require use of known properties
The following rules flag for compatibility problems across browsers and browser settings.
- Disallow adjoining classes
- Disallow box-sizing
- Require compatible vendor prefixes
- Require all gradient definitions
- Disallow negative text-indent
- Require standard property with vendor prefix
- Require fallback colors
- Disallow star hack (new in v0.9.8)
- Disallow underscore hack (new in v0.9.8)
The following rules are aimed at improving CSS performance, including runtime performance and overall code size.
- Don't use too many web fonts
- Disallow @import
- Disallow selectors that look like regular expressions
- Disallow universal selector
- Disallow unqualified attribute selectors
- Disallow units for zero values
- Disallow overqualified elements
- Require shorthand properties
- Disallow duplicate background images
These rules help to ensure your code is readable and maintainable by others.
- Disallow too many floats
- Don't use too many font-size declarations
- Disallow IDs in selectors
- Disallow !important
These rules are designed to pick out possible accessibility issues.
These rules are based on the principles of OOCSS.