- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Tue, 21 Feb 2023 23:39:01 +0000
- To: public-css-archive@w3.org
Yeah, `:is()` is a no-op (ignoring specificity) *if* you wrap an *entire* selector in it, or you wrap just a compound selector in it. If you have a combinator inside the `:is()` *and* outside it, it does indeed change the behavior. And since `:has()`'s argument is a relative selector, it *always* has a (perhaps implicit) combinator at the start, which you can't include in the `:is()`, so wrapping the entire `:has()` argument will always run afoul of this issue. You have to instead push it down to just wrap compound selectors, or lift it entirely outside as `:is(:has(...))`. (Lifting it outside doesn't act quite the same - it'll prevent an invalid selector in :has() from invalidating the whole selector, but it won't let you drop *just* the invalid selector from the :has() argument and continue with the rest. But generally that should be fine.) -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8430#issuecomment-1439231221 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 21 February 2023 23:39:03 UTC