-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range syntax for media/container queries #141
Comments
Does the container queries bit of this overlap with #133? |
Right. I found it is tested separately. The Containment spec defines |
Note that web-platform-tests/wpt#35435 and w3c/csswg-drafts#7595 are open issues which heavily effect these test results. |
There were some mentions of this feature in State of CSS 2022, although not enough to make the top list in #248. I can count 9 mentions, for example this one:
|
In the MDN short survey on CSS & HTML, "CSS media queries range syntax (example: |
Thank you for proposing range syntax for media/container queries for inclusion in Interop 2023. We are pleased to let you know that this proposal was accepted as the Container Queries and Media Queries 4 focus areas. You can follow the progress of these Focus Area on the Interop 2023 dashboard. For an overview of our process, see the proposal selection summary. Thank you for contributing to Interop 2023! Posted on behalf of the Interop team. |
Description
Range syntax allows authors to write media (and container) queries using
>
,<
, and=
instead of multiple expressions ofmin-
andmax-
prefixed media features.It is especially powerful when there are multiple conditions:
Rationale
The new syntax will be a welcome addition to the platform; it improves readability and reduce complexity of the query.
People blogged about it:
and got excited about it's (already) shipped in browsers.
Yes, there are already some implementations for the feature:
with > 600px
) since late 2018. Looks like complex ones (2021px <= width < 2023px
) landed lately.So, there are some interoperability issues; not great, but good for this project!
Since container queries are gaining traction, more people will start (again) writing query syntax. It would be so nice developers not forced to "downgrade" the query syntax to the classic ones.
Specification
https://w3c.github.io/csswg-drafts/mediaqueries-4/#mq-range-context
Tests
test:
http://wpt.live/css/mediaqueries/test_media_queries.html
wpt.fyi:
https://wpt.fyi/results/css/mediaqueries/test_media_queries.html?label=master&label=experimental&aligned&view=subtest
source:
Those tests only cover
width
,height
,device-width
, anddevice-height
media features. Maybe it's nice to addresolution
to the tests.The text was updated successfully, but these errors were encountered: