Pattern: Missing use of nesting
Issue: -
Enforces nesting when it is possible in CSS.
If the first option is "always"
or true
, then [Stylelint Use Nesting]
requires all nodes to be linted, and the following patterns are not
considered violations:
.example {
color: blue;
&:hover {
color: rebeccapurple;
}
}
.example {
color: blue;
@media (min-width: 640px) {
color: rebeccapurple;
}
}
While the following patterns are considered violations:
.example {
color: blue;
}
.example:hover {
color: rebeccapurple;
}
.example {
color: blue;
}
@media (min-width: 640px) {
.example {
color: rebeccapurple;
}
}