Skip to content

noDuplicateCustomProperties

Diagnostic Category: lint/nursery/noDuplicateCustomProperties

Since: v1.9.0

Sources:

Disallow duplicate custom properties within declaration blocks.

This rule checks the declaration blocks for duplicate custom properties.

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.

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