Skip to main content

declaration-block-single-line-max-declarations

限制单行声明块内的声明数量。

¥Limit the number of declarations within a single-line declaration block.

a { color: pink; top: 0; }
/** ↑ ↑

* The number of these declarations */

message 次要选项 可以接受该规则的参数。

¥The message secondary option can accept the arguments of this rule.

选项

¥Options

int:允许的最大声明数量。

¥int: Maximum number of declarations allowed.

例如,对于 1

¥For example, with 1:

以下模式被视为问题:

¥The following patterns are considered problems:

a { color: pink; top: 3px; }
a,
b { color: pink; top: 3px; }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { color: pink; }
a,
b { color: pink; }
a {
color: pink;
top: 3px;
}