selector-attribute-quotes
What it does
Section titled “What it does”Reports an attribute selector whose value is not quoted ([a=b]).
Why it matters
Section titled “Why it matters”An unquoted value must be a valid identifier, so a value with a space, a digit at the start or a punctuation mark makes the selector invalid and the rule is dropped. Always quoting avoids the trap.
To fix, wrap the value in quotes: [a="b"].
Example
Section titled “Example”...[a=b], [a="b"], [a], [a~=b i] {}...@keyframes k { from { top: 0 } to { top: 1px } }......[a=b], [a="b"], [a], [a~=b i] {}...@keyframes k { from { top: 0 } to { top: 1px } }...Configuration
Section titled “Configuration”css: lint: rules: selector-attribute-quotes: warn # off (default), warn, errorless: lint: rules: selector-attribute-quotes: warn # off (default), warn, errorscss: lint: rules: selector-attribute-quotes: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line selector-attribute-quotes 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-attribute-quotes |
full |