- From: Brandon McConnell via GitHub <sysbot+gh@w3.org>
- Date: Fri, 13 Jan 2023 19:52:23 +0000
- To: public-css-archive@w3.org
@tabatkins No worries. My two questions, put more succinctly and clearly (I hope) areā¦ * If `&` will now refer to `:root` instead of the current element when used in `:is`, `:where`, and `:has`, how can we target an element as **_not_** being preceded by a certain selector. Before, I would have used something like `.b:is(.a ~ &)` to target `.b` when it does not have a previous `.a` sibling, but IIUC, that would not work now, as `&` would refer to the parent selector or `:scope` respectively when used in `:is`, `:where`, or `:has`. In other words, would this still work the way it would have before, where `&` referred to the element the selector targets?: ```scss .b:is(.a ~ &) { ... } ``` * To make a selector list forgiving inside `:has()`, the general direction has been to nest an `:is()` inside the `:has()` like this: `:has(:is())`. However, I'm not sure how that would work for selectors within has that start with combinators, such as `.a:has(> .b:unsupported-pseudo)`. My understanding is that `:has()` can start with a combinator like `:has(> _)` but `:has(:is(> _))` does not have that same capability. With that in mind, how might I make this selector forgiving?: `.a:has(> .b:unsupported-pseudo)`, presuming that `.a:has(:is(> .b:unsupported-pseudo))` not work? In other words, would this work the way it would have before, where `&` referred to the element the selector targets?: ```scss .a:has(:is(& > .b:unsupported-pseudo)) { ... } ``` I was using `&` to refer to the current selector since I assumed I couldn't simply start with a combinator within `:has(:is())` like `.a:has(:is(> .b:unsupported-pseudo))` -- GitHub Notification of comment by brandonmcconnell Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5745#issuecomment-1382322129 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 19:52:24 UTC