Skip to content

selector-max-universal

Reports a selector with more * than the max option.

The universal selector matches everything, so each one widens the rule, and * * can cost time on large pages. A limit keeps such selectors rare.

Reported
.a.b.c, #x #y, a b c d, [p][q], * *, a:hover:focus { color: red }
...
.i {
...
css:
lint:
rules:
selector-max-universal:
level: warn # off (default), warn, error
options:
max: 0
less:
lint:
rules:
selector-max-universal:
level: warn # off (default), warn, error
options:
max: 0
scss:
lint:
rules:
selector-max-universal:
level: warn # off (default), warn, error
options:
max: 0
Option Type Default Description
max int 0 The most universal selectors a selector may have.

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