You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
}
Activity
DMartens commentedon Sep 1, 2026
I agree that this would be a helpful rule.
As this is a rule proposal, we should get more opinions from the team.
nzakas commentedon Oct 20, 2026
Sounds good to me. 👍