shorthand-property-no-redundant-values
What it does
Section titled “What it does”Reports a margin, padding, border-color, border-style, border-width or border-radius with two, three or four values that repeat (1px 1px is 1px).
Why it matters
Section titled “Why it matters”CSS fills the missing values of these shorthands by repeating the others, so the longer form says the same as the shorter one. The short form is easier to read and cannot have one value changed by mistake.
To fix, delete the values that the shorthand repeats by itself.
Example
Section titled “Example”... padding: 1px 1px; padding: 1px 2px 1px 2px; padding: 1px 2px 3px 2px;...}Configuration
Section titled “Configuration”css: lint: rules: shorthand-property-no-redundant-values: warn # off (default), warn, errorless: lint: rules: shorthand-property-no-redundant-values: warn # off (default), warn, errorscss: lint: rules: shorthand-property-no-redundant-values: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line shorthand-property-no-redundant-values 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 | shorthand-property-no-redundant-values |
full |