Re: [csswg-drafts] [css-conditional] CSS.supports for media queries? (#5272)

https://github.com/w3c/csswg-drafts/issues/5272#issuecomment-651954249

`let testMedia = str => matchMedia(`${str}, not all and ${str}`).matches;`

---

This suggestion would only cover a small number of possible media queries.

Examples where this string interpolation of media queries would not work as expected :
- `(width) or (height)`
- `screen`
- `only screen`
- `not screen`
- `not (width)`
- all variations and more complicated examples of the above

It would only work for `and` separated queries and media queries without a type or modifier:
- `(width)`
- `(width) and (height)`

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


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

Received on Thursday, 17 August 2023 16:36:27 UTC