Re: [csswg-drafts] [css-nesting-1] Clarify valid position of `&` in a selector (#9940)

> In Chrome/FF, the nested rule in ::before, div { &:first-child {} } is valid whereas the version without nesting, ::before:first-child, div:first-child {} is not

That's also correct behavior. We don't "expand" the & in a nested selector, it just represents the elements matched by the parent selector. It doesn't represent pseudo-elements, so in this example it ends up matching the `div`s on the page. That's perfectly fine.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9940#issuecomment-1941949304 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 13 February 2024 16:27:24 UTC