Philipp Partosch 46a936d7de added all files to project | 2 years ago | |
---|---|---|
.. | ||
README.md | 2 years ago | |
index.js | 2 years ago |
Disallow qualifying a selector by type.
a.foo {}
/** ↑
* This type selector is qualifying the class */
A type selector is “qualifying” when it is compounded with (chained to) another selector (e.g. a.foo
, a#foo
). This rule does not regulate type selectors that are combined with other selectors via a combinator (e.g. a > .foo
, a #foo
).
true
The following patterns are considered violations:
a.foo {
margin: 0
}
a#foo {
margin: 0
}
input[type='button'] {
margin: 0
}
The following patterns are not considered violations:
.foo {
margin: 0
}
#foo {
margin: 0
}
input {
margin: 0
}
ignore: ["attribute", "class", "id"]
"attribute"
Allow attribute selectors qualified by type.
The following patterns are not considered violations:
input[type='button'] {
margin: 0
}
"class"
Allow class selectors qualified by type.
The following patterns are not considered violations:
a.foo {
margin: 0
}
"id"
Allow ID selectors qualified by type.
The following patterns are not considered violations:
a#foo {
margin: 0
}