Skip to content

selector-pseudo-element-disallowed-list

Reports a pseudo-element that is in the list option.

A project can forbid a pseudo-element that its browsers do not support or that its design avoids. The rule is a policy: with no list it reports nothing.

Reported
...
}
a:hover::before > b[style] { color: red; width: calc(1px + 2px); --x: 1em }
...
css:
lint:
rules:
selector-pseudo-element-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
less:
lint:
rules:
selector-pseudo-element-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
scss:
lint:
rules:
selector-pseudo-element-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
Option Type Default Description
list list [] The disallowed pseudo-elements, without colons: names, or /regex/.

Suppress one line with sudsy-disable-next-line selector-pseudo-element-disallowed-list 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-pseudo-element-disallowed-list full