Skip to content

custom-property-empty-line-before

Reports a custom property declaration with no empty line before it. One that is first in its block, right after a comment or another custom property, or in a single-line block is not reported.

Custom properties are the variables of a block, and a gap before the first of them sets them off from the ordinary declarations, so a reader finds the values a block defines.

With this configuration:

dollar-variable-empty-line-before: warn
custom-property-empty-line-before: warn
double-slash-comment-empty-line-before: warn
no-empty-comment: { level: warn, options: { separators: true } }
Reported
...
$d: 4;
color: red;
...
--f: 6;
--g: 7;
...
...
css:
lint:
rules:
custom-property-empty-line-before: warn # off (default), warn, error
less:
lint:
rules:
custom-property-empty-line-before: warn # off (default), warn, error
scss:
lint:
rules:
custom-property-empty-line-before: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line custom-property-empty-line-before in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint custom-property-empty-line-before full