Re: [csswg-drafts] [css-nesting] How to resolve nested CSS with pseudo elements in the parent (#7433)

Because an element is never a pseudo-element (and you can't generically select a pseudo-element and then test its name in an `:is()`).

That is, `div:is(::before)` is asking "is the `div` a `::before`?" and that's never true (and similarly, `::before:is(::before)` is either always or never true, depending on if the names match or not). What people *expect* it to mean is "change the subject of the selector to the div's ::before pseudo", but pseudo-classes can't change the subject; you need a combinator for that. 

Ultimately the problem is that early CSS screwed up the pseudo-element syntax, making it look like a pseudo-class (literally spelled it `:before`; the double-colon came later) rather than like a combinator+name. (There's some other issues to potentially fix that, tho I can't dig them up at the moment.)

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


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

Received on Thursday, 6 April 2023 00:45:44 UTC