Skip to content

Files

Latest commit

 

History

History
52 lines (37 loc) · 983 Bytes

custom-property-no-missing-var-function.md

File metadata and controls

52 lines (37 loc) · 983 Bytes

Pattern: Missing var for custom property

Issue: -

Description

Disallow missing var function for custom properties.

    :root { --foo: red; }
    a { color: --foo; }
/**            ↑
 *             This custom property */

This rule only reports custom properties that are defined within the same source.

Examples

true

The following patterns are considered problems:

:root { --foo: red; }
a { color: --foo; }
@property --foo {}
a { color: --foo; }

The following patterns are not considered problems:

:root { --foo: red; }
a { color: var(--foo); }
@property --foo {}
a { color: var(--foo); }

Further Reading