selector-no-qualifying-type
What it does
Section titled “What it does”Reports a type selector in the same compound as a class, id or attribute selector (ul.nav).
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...}a:hover::before > b[style] { color: red; width: calc(1px + 2px); --x: 1em }...Configuration
Section titled “Configuration”css: lint: rules: selector-no-qualifying-type: warn # off (default), warn, errorless: lint: rules: selector-no-qualifying-type: warn # off (default), warn, errorscss: lint: rules: selector-no-qualifying-type: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line selector-no-qualifying-type in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | selector-no-qualifying-type |
full |