Rule details
Disallow the nesting selector (&) in a context with no scoping root
What type of rule is this?
Warns about a potential problem
Example code
/* ✗ no enclosing style rule: per css-nesting, `&` here "represents the same
elements as :scope", so this silently styles the root element */
& {
color: red;
}
/* ✓ the enclosing style rule is the scoping root */
a {
& span {
color: red;
}
}
Prior Art
https://stylelint.io/user-guide/rules/nesting-selector-no-missing-scoping-root
Participation
AI acknowledgment
Additional comments
No response
Rule details
Disallow the nesting selector (
&) in a context with no scoping rootWhat type of rule is this?
Warns about a potential problem
Example code
Prior Art
https://stylelint.io/user-guide/rules/nesting-selector-no-missing-scoping-root
Participation
AI acknowledgment
Additional comments
No response