Skip to content

selector-type-case

Reports a type selector with capitals (A {}).

HTML element names are matched without regard to case, so A and a select the same elements and capitals only add spellings. Lowercase is the convention and the one the markup uses.

To fix, write the selector in lowercase.

Reported
...
@container good-box (min-width: 1px) { a { color: red } }
A, B.c:not(.dX) {}
css:
lint:
rules:
selector-type-case: warn # off (default), warn, error
less:
lint:
rules:
selector-type-case: warn # off (default), warn, error
scss:
lint:
rules:
selector-type-case: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line selector-type-case in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
stylelint selector-type-case partial differs from stylelint on camelCase SVG element names (clipPath)