declaration-block-no-duplicate-custom-properties
Disallow duplicate custom properties within declaration blocks.
a { --custom-property: pink; --custom-property: orange; }/** ↑ ↑ * These duplicated custom properties */Use this rule to avoid declarations that never apply. Browsers don’t check custom property values when parsing, so a repeated custom property always overrides the earlier one, which can’t act as a fallback.
This rule is case-sensitive.
This rule supports 1 message argument: the duplicate custom property.
Options
Section titled “Options”{ "declaration-block-no-duplicate-custom-properties": true}The following patterns are considered problems:
a { --custom-property: pink; --custom-property: orange; }a { --custom-property: pink; background: orange; --custom-property: orange }The following patterns are not considered problems:
a { --custom-property: pink; }a { --custom-property: pink; --cUstOm-prOpErtY: orange; }Optional secondary options
Section titled “Optional secondary options”ignoreProperties
Section titled “ignoreProperties”{ "ignoreProperties": ["array", "of", "properties", "/regex/"] }Ignore duplicates of specific properties.
Given:
{ "declaration-block-no-duplicate-custom-properties": [ true, { "ignoreProperties": ["--custom-property", "/ignored/"] } ]}The following patterns are considered problems:
a { --another-custom-property: 1; --another-custom-property: 1; }The following patterns are not considered problems:
a { --custom-property: 1; --custom-property: 1; }a { --custom-ignored-property: 1; --custom-ignored-property: 1; }