CSSLint
Parsing errors should be fixed(应当修正解析错误)
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.
解析错误是指代码编写的错误导致的浏览器弃掉这栏规则或者是整个栏目的规则.
Possible Errors(可能的错误)
The following rules point out potential errors in your CSS.(潜在错误)
- Beware of box model size(当心盒模型)
- Require properties appropriate for display (给display使用合适的属性)
- Disallow duplicate properties(不要使用重复属性)
- Disallow empty rules(不要使用空属性值)
- Require use of known properties(不要使用未知属性)
Compatibility(兼容性)
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 (不许星标hack)
- Disallow underscore hack (不许下划线hack)
Performance
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(禁止使用 import)
- Disallow selectors that look like regular expressions(禁止正则表达式选择器)
- Disallow universal selector(禁用通用选择器)
- Disallow unqualified attribute selectors(禁用不规则的属性选择器)
- Disallow units for zero values(0不要给其规定单位)
- Disallow overqualified elements(禁用过度使用的元素+class选择器)
- Require shorthand properties(简写属性)
- Disallow duplicate background images(禁用重复的背景图指定)
Maintainability & Duplication
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(不要在选择器中使用ID)
- Disallow !important(禁用important)
Accessibility
These rules are designed to pick out possible accessibility issues.
- Disallow outline:none(禁用outline:none)
OOCSS
These rules are based on the principles of OOCSS.
- Disallow qualified headings(禁用过度header命名)
- Headings should only be defined once(标题应当只定义一次)