Skip to content

selector-no-qualifying-type

Reports a type selector in the same compound as a class, id or attribute selector (ul.nav).

The element name adds specificity and ties the rule to one element: changing ul to ol breaks the style, while .nav would have kept working.

To fix, delete the type selector.

Reported
...
}
a:hover::before > b[style] { color: red; width: calc(1px + 2px); --x: 1em }
...
css:
lint:
rules:
selector-no-qualifying-type: warn # off (default), warn, error
less:
lint:
rules:
selector-no-qualifying-type: warn # off (default), warn, error
scss:
lint:
rules:
selector-no-qualifying-type: warn # off (default), warn, error

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