declaration-empty-line-before
What it does
Section titled “What it does”Reports a declaration that follows a rule or at-rule and has no empty line before it. A declaration after another declaration, one first in its block, one right after a comment, one in a single-line block, and custom properties and variables are not reported.
Why it matters
Section titled “Why it matters”Declarations that come after a nested rule belong to the parent again, and without a gap they read as part of the nested block. An empty line shows the return to the parent.
Example
Section titled “Example”...
f {
color: red; top: 0;
left: 0; /* c */ right: 0; g { x: y }... bottom: 0;}... --b: 2;
--c: 3; color: red; }...Configuration
Section titled “Configuration”css: lint: rules: declaration-empty-line-before: warn # off (default), warn, errorless: lint: rules: declaration-empty-line-before: warn # off (default), warn, errorscss: lint: rules: declaration-empty-line-before: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line declaration-empty-line-before in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | declaration-empty-line-before |
full |