Re: [csswg-drafts] [css-conditional-4] Need a way in CSS to test for support of HTML features (#9746)

Put another way, the reason you want feature detection from CSS is so that you can style the thing on one way instead of in another way. Concretely:

* Write styles that apply to checkboxes but not switches in browsers that support just checkboxes as well as browsers that support both
* Write styles that apply to switches in browsers that support them and don't get applied at all in browsers that don't support switches)

The first one is just `input:not([switch])`, I think.
The second is really interesting. @nt1m tells me `:has()` doesn't support pseudo-elements, which is a real bummer, because `input[type=checkbox][switch]:has(::track)` would be the obvious and nice solution to this if it worked.

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


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

Received on Thursday, 21 December 2023 22:43:17 UTC