Skip to content

shorthand-property-no-redundant-values

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).

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.

Reported
...
padding: 1px 1px;
padding: 1px 2px 1px 2px;
padding: 1px 2px 3px 2px;
...
}
css:
lint:
rules:
shorthand-property-no-redundant-values: warn # off (default), warn, error
less:
lint:
rules:
shorthand-property-no-redundant-values: warn # off (default), warn, error
scss:
lint:
rules:
shorthand-property-no-redundant-values: warn # off (default), warn, error

Enabled 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.

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

Tool Rule Match
stylelint shorthand-property-no-redundant-values full