[csswg-drafts] [css-nesting-1] Behavior of nesting within pseudo element selectors (#7912)

sesse has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting-1] Behavior of nesting within pseudo element selectors ==
What is the correct behavior of this?

```html
<style>
div::before {
  & {
    content: "test";
  }
}
</style>
<div>xyz</div>
```

FWIW, my preferred resolution would be “inner rule matches nothing”, since pseudo element selectors are not allowed within :is() and & is generally defined in terms of :is(), but the spec is not clear on this (it doesn't define & as exactly equivalent to :is(), just that it matches the elements of the parent rule and has the same specificity).

The other two alternatives would be either parse error (difficult when taking CSSOM into account) or that it actually would be equivalent with writing out div::before (problematic when combining & with further selectors).

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7912 using your GitHub account


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

Received on Wednesday, 19 October 2022 09:44:04 UTC