Skip to content

selector-no-deprecated

Reports a deprecated pseudo-class, pseudo-element or HTML or SVG element used as a type selector (center {}).

A deprecated selector targets something that the standard removed, so it matches less and less over time, and browsers may drop it.

To fix, use the replacement named in the specification.

Reported
...
center, a:matches(b), a::content, b {}
css:
lint:
rules:
selector-no-deprecated:
level: warn # off (default), warn, error
options:
ignore: []
less:
lint:
rules:
selector-no-deprecated:
level: warn # off (default), warn, error
options:
ignore: []
scss:
lint:
rules:
selector-no-deprecated:
level: warn # off (default), warn, error
options:
ignore: []
Option Type Default Description
ignore list [] Names left out: names, or /regex/.

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line selector-no-deprecated 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 selector-no-deprecated full