[csswg-drafts] [css-nesting-1] Invalid nested selectors for a pseudo-element selector (#7503)

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

== [css-nesting-1] Invalid nested selectors for a pseudo-element selector ==
I think CSS Nesting or CSS Selector 4 (probably the former) should clarify something like *"An invalid complex or compound selector remains invalid when some of its parts are nested"*:

```css
::before {
  &:hover {} /* valid */
  & div {} /* invalid */
}
```

Currently, in [CSS Selector 4](https://api.csswg.org/bikeshed/#pseudo-element-states):

> A pseudo-element may be immediately **followed** by any combination of the user action pseudo-classes [...].

> Note that, unless otherwise specified in a future specification, pseudo-classes other than the user action pseudo-classes are not valid when **compounded** to a pseudo-element; so, for example, `::before:first-child` is an invalid selector.

> Some pseudo-elements are defined to have internal structure. These pseudo-elements may be **followed** by child/descendant combinators to express those relationships. Selectors **containing combinators after the pseudo-element** are otherwise invalid.

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


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

Received on Friday, 15 July 2022 09:37:18 UTC