メインコンテンツにスキップ

declaration-block-no-duplicate-custom-properties

宣言ブロック内でのカスタムプロパティの重複を禁止します。

a { --custom-property: pink; --custom-property: orange; }
/** ↑ ↑
* These duplicated custom properties */

このルールは大文字と小文字を区別します。

message セカンダリオプションは、このルールの引数を受け入れることができます。

オプション

true

以下のパターンは問題とみなされます。

a { --custom-property: pink; --custom-property: orange; }
a { --custom-property: pink; background: orange; --custom-property: orange }

以下のパターンは問題とはみなされません

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

オプションのセカンダリオプション

ignoreProperties: ["/regex/", /regex/, "non-regex"]

特定のプロパティの重複を無視します。

与えられた

["--custom-property", "/ignored/"]

以下のパターンは問題とみなされます。

a { --another-custom-property: 1; --another-custom-property: 1; }

以下のパターンは問題とはみなされません

a { --custom-property: 1; --custom-property: 1; }
a { --custom-ignored-property: 1; --custom-ignored-property: 1; }