-
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
Custom Media Queries #421
Comments
Bug report for Mozilla: Bug report for WebKit: |
this can be emulated using style queries (#433): @media (width <= 40em) {
:root { --screen: mobile; }
}
@media (width <= 70em) {
:root { --screen: desktop; }
}
@container style(--screen: mobile) {
/* styles */
}
@container style(--screen: desktop) {
/* styles */
} |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Do you intend for this to include the script-based version of this? There is not spec for that yet. This proposal could be for the declarative version only, as your examples show. Correct? |
Are there any tests for the declarative feature here in WPT already? |
To answer my own questions, I did a search for "custom-media" in WPT and didn't find anything, so I guess there are no tests yet. |
Thank you for proposing Custom Media Queries for inclusion in Interop 2024. We wanted to let you know that this proposal was not selected to be part of Interop this year. As of the deadline, the specifications for Custom Media Queries were not yet complete enough to allow interoperable implementations. To make progress on this area in the future, it will first be necessary to ensure that the feature has a clear specification in a standards track document. For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2024! Posted on behalf of the Interop team. |
Description
The Media Queries Level 5 specification defines “Custom Media Queries” as named aliases for longer and more complex media queries. With custom media queries developers define them once and use them in multiple places, simplifying the process of updating the media query to a single line of code.
Example:
Furthermore, with the help of JS
CSS.customMedia.set()
, developers will be able to change breakpoints dynamically.Specification
https://www.w3.org/TR/mediaqueries-5/#custom-mq
Open Issues
No response
Tests
No response
Current Implementations
Standards Positions
No response
Browser bug reports
https://bugs.chromium.org/p/chromium/issues/detail?id=1234172
Developer discussions
https://open-props.style/#media-queries
Polls & Surveys
No response
Existing Usage
No response
Workarounds
this can be emulated using style queries (#433):
Accessibility Impact
No accessibility impact.
Privacy Impact
No privacy impact.
The text was updated successfully, but these errors were encountered: