Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.27 KB

File metadata and controls

39 lines (29 loc) · 1.27 KB

no-duplicate-registered-properties

Disallow duplicate @property registrations.

@property --brand-color { syntax: "<color>"; inherits: false; initial-value: red; }
@property --brand-color { syntax: "<color>"; inherits: false; initial-value: blue; }
/*         ↑
 * This duplicate registration */

Registering the same custom property name more than once with @property is almost always a mistake. The second registration silently overrides the first, leaving one of them dead code and making it unclear which syntax or initial value applies.

Options

true

The following patterns are considered violations:

@property --color { syntax: "<color>"; inherits: false; initial-value: red; }
@property --color { syntax: "<color>"; inherits: false; initial-value: blue; }
@property --spacing { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --spacing { syntax: "<length>"; inherits: true; initial-value: 8px; }

The following patterns are not considered violations:

@property --color { syntax: "<color>"; inherits: false; initial-value: red; }
@property --spacing { syntax: "<length>"; inherits: true; initial-value: 0px; }