Skip to main content

declaration-property-max-values

限制声明中属性列表的值的数量。

¥Limit the number of values for a list of properties within declarations.

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

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

选项

¥Options

Object<string, number>

{ "unprefixed-property-name": 0 }

指定属性和最大值的对。实际上,您应该指定任意正整数作为最大值。

¥Specify pairs of a property and a max value. In practice, you should specify any positive integers as max values.

您可以为属性名称指定正则表达式,例如 { "/^margin/": 0 }

¥You can specify a regex for a property name, such as { "/^margin/": 0 }.

鉴于:

¥Given:

{
"declaration-property-max-values": {
"border": 2,
"/^margin/": 1
}
}

以下模式被视为问题:

¥The following patterns are considered problems:

a { border: 1px solid blue; }
a { margin: 1px 2px; }
a { margin-inline: 1px 2px; }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { border: 1px solid; }
a { margin: 1px; }
a { margin-inline: 1px; }