Skip to content

Instantly share code, notes, and snippets.

@WangShuXian6
Forked from xiajngsi/cssLint 中文翻译
Created January 31, 2018 05:43
Show Gist options
  • Save WangShuXian6/b0c3830d36749f0ef8698d94e0de0655 to your computer and use it in GitHub Desktop.
Save WangShuXian6/b0c3830d36749f0ef8698d94e0de0655 to your computer and use it in GitHub Desktop.
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(标题应当只定义一次)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment