编写规则
¥Writing rules
请帮助我们创建、增强和调试我们的规则!
¥Please help us create, enhance, and debug our rules!
添加规则
¥Add a rule
你应该为 贡献代码 做好准备。
¥You should get yourself ready to contribute code.
定义规则
¥Define the rule
规则必须是:
¥A rule must be:
-
仅适用于标准 CSS 语法
¥for standard CSS syntax only
-
一般有用;不拘泥于特殊的模式
¥generally useful; not tied to idiosyncratic patterns
并有一个:
¥And have a:
-
明确的完成状态
¥unambiguous finished state
-
与其他规则不重叠的单一目的
¥singular purpose that doesn't overlap with other rules
它的名字分为两部分:
¥Its name is split into two parts:
-
规则适用的 thing,例如
at-rule
¥the thing the rule applies to, e.g.
at-rule
-
规则正在检查什么,例如
disallowed-list
¥what the rule is checking, e.g.
disallowed-list
除非它适用于整个源代码,否则就没有第一部分。
¥Unless it applies to the whole source, then there is no first part.
编写测试
¥Write tests
你应该为以下所有模式添加测试用例:
¥You should add test cases for all patterns that are:
-
考虑的问题
¥considered problems
-
不考虑的问题
¥not considered problems
你应该使用:
¥You should use:
-
真实的 CSS,避免使用省略号
¥realistic CSS, avoiding the use of ellipses
-
尽可能少的代码,例如 如果定位选择器,则使用空规则
¥the minimum amount of code possible, e.g. use an empty rule if targeting selectors
-
{}
表示空规则,而不是{ }
¥
{}
for empty rules, rather than{ }
-
默认为
a
类型选择器