Re: [csswg-drafts] [selectors][css-nesting] Move nest-containing and nest-prefixed selector definitions to Selectors (#5745)

> how can we target an element as not being preceded by a certain selector.

Why not just `*` (or `*|*` is you use namespaces)? So `.b:not(.a ~ *) { ... }` selects elements with a `b` class which are not preceded by a sibling with the `a` class.

> the general direction has been to nest an `:is()` inside the `:has()`

Be aware there is an important difference: `a:has(b c)` selects `a` elements that contain a `b` descendant which contains a `c` descendant. While `a:has(:is(b c))` selects `a` elements that contain a `c` descendant which has a `b` ancestor; note that `b` doesn't need to be a descendant of `a`!

And `:is()` doesn't take a relative selector, but why not use `.a:has(> :is(.b:unsupported-pseudo))`?



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


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

Received on Friday, 13 January 2023 20:22:27 UTC