Skip to content

noDuplicateCustomProperties

诊断类别:lint/nursery/noDuplicateCustomProperties

¥Diagnostic Category: lint/nursery/noDuplicateCustomProperties

自从:v1.9.0

¥Since: v1.9.0

来源:

¥Sources:

禁止在声明块中重复自定义属性。

¥Disallow duplicate custom properties within declaration blocks.

此规则检查声明块中是否存在重复的自定义属性。

¥This rule checks the declaration blocks for duplicate custom properties.

¥Examples

¥Invalid

a { --custom-property: pink; --custom-property: orange; }
code-block.css:1:30 lint/nursery/noDuplicateCustomProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate custom properties are not allowed.

> 1 │ a { —custom-property: pink; —custom-property: orange; }
^^^^^^^^^^^^^^^^^
2 │

Consider removing the duplicate custom property.

a { --custom-property: pink; background: orange; --custom-property: orange }
code-block.css:1:50 lint/nursery/noDuplicateCustomProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate custom properties are not allowed.

> 1 │ a { —custom-property: pink; background: orange; —custom-property: orange }
^^^^^^^^^^^^^^^^^
2 │

Consider removing the duplicate custom property.

¥Valid

a { --custom-property: pink; }
a { --custom-property: pink; --cUstOm-prOpErtY: orange; }

¥Related links