- From: Brandon McConnell via GitHub <sysbot+gh@w3.org>
- Date: Thu, 12 Jan 2023 01:02:47 +0000
- To: public-css-archive@w3.org
@romainmenke @fantasai With that change, how could one target a selector dependant on ***not*** having a specific selector before it?
Some examples:
```scss
.b:is(.a ~ &) { ... }
.b:is(.a &) { ... }
```
Surely, the expectation out, like this, right?:
```scss
.some-long-classname#and-an-id:is(.prev-sibling ~ .some-long-classname#and-an-id) { ... }
.some-long-classname#and-an-id:is(.ancestor .some-long-classname#and-an-id) { ... }
```
Would the best alternative be to swap `&` or the universal selector `*`? Would this cause any speed deficits that `&` would not have already caused in its original spec?:
```scss
.b:is(.a ~ *) { ... }
.b:is(.a *) { ... }
```
Something like this ☝🏼 seems like a good alternative. I just want to clarify whether this change affects any optimization benefits achieved by using `&` to select the current element within `:is`, `:where`, or `:has` in the previous spec.
Essentially…
* `.b:is(.a ~ &) { ... }` vs. `.b:is(.a ~ *) { ... }`
* `.b:is(.a &) { ... }` vs. `.b:is(.a *) { ... }`
--
GitHub Notification of comment by brandonmcconnell
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5745#issuecomment-1379676203 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 12 January 2023 01:02:48 UTC