This rule raises an issue when a declaration block declares the same custom property more than once.

Why is this an issue?

At equal importance, the later declaration overrides the earlier one, so changing the earlier declaration has no effect. Keep the declaration with the intended value and remove the duplicate.

Duplicates are reported even when they have the same value or are separated by other declarations.

In the following example, both declarations have equal importance and orange is the intended value, so removing the earlier declaration keeps the current behavior.

Noncompliant code example

a {
  --color: pink;
  --color: orange; /* Noncompliant */
}

Compliant solution

a {
  --color: orange;
}

Before removing a declaration, check its importance: !important declarations take precedence over normal declarations.

For declarations that parse and have equal importance, an unsupported value inside a custom property does not make the browser use the earlier declaration. Instead, guard the alternative value with a feature test such as @supports (color: oklch(50% 0.2 30)).

Exceptions

Custom property names are case-sensitive: --color and --Color are distinct. Declarations in separate blocks and ordinary CSS properties are outside this rule.

The ignoreProperties parameter accepts comma-separated custom-property names or /regular-expression/ patterns to ignore. Names are case-sensitive. The default is empty.

Resources

Documentation