Re: [csswg-drafts] [selectors] Let :matches() have better error-recovery behavior than normal Selectors

@CyberAP, the point is to avoid having to write the same rules twice (for new and all browsers).

For example, consider a menu that is by default `transform`ed into a hamburger icon (or something), but should "uncollapse" if either hovered or has a link inside it focused via keyboard. For modern browsers, I can write
```css
.menu:hover, .menu:focus-within { transform: none; }
```
...but in browsers that don't support `:focus-within` this would not apply at all, and I would have to write this rule twice, for each selector separately, in order to make at least the `:hover` part work there.

However, with the new proposal, the following hypothetical example
```css
:is(.menu:hover, .menu:focus-within, :current(.menu)) { transform: none; }
```
would be able to work in browsers that already support `:is()` and these two pseudo-classes, but don't support time-dimensional pseudo-classes yet.

How can this be solved with `@supports` (even if extended to test for selectors)? For me, this looks like the opposite of what `@supports` does (combining the code for old and new browsers into one rule, rather than separating it into different rules). Would be happy to be proven wrong!

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

Received on Monday, 29 October 2018 21:21:56 UTC