-
-
Notifications
You must be signed in to change notification settings - Fork 83
Allow custom media queries to be used in @container rules #671
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
Allow custom media queries to be used in @container rules #671
Conversation
|
@gabrielgrant thanks for this PR. However we won't be integrating this within The reason is that that's not part of any spec and it hasn't even been drafted. For whatever is worth, none of the proposals related to custom-media or anything in that line is getting any traction with browsers nor CSSWG so we're hesitant to add tooling without, at least, a draft spec. This is the closest to what you're suggesting but it didn't get picked either (for now) w3c/csswg-drafts#7622 |
|
@Antonio-Laguna thanks for taking a look. from the discussion in w3c/csswg-drafts#6698 it sounds like the plan is for the functionality of |
|
Hi @gabrielgrant, there is no plan to use The complexity here is that browsers do not treat these things as strings. For a browser these are two completely different things. So a catch-all API that allows you to inject full media queries in I think it might even be best to open a new issue at csswg-drafts, asking them to include custom container queries in the specification. The issues linked here are unlikely to move forward but something like |
|
Side note : We are extra careful with additions and new plugins and try to align them very closely to native browser behavior. But you should not feel limited by this. |
|
@gabrielgrant I've opened an issue requesting for a specification update for custom container queries : w3c/csswg-drafts#8121 Initial feedback is not negative :) I am closing this pull request only because we can not add to the plugin If there is a little bit more progress on this in the CSSWG we obviously want to have a mirror plugin like the one for |
|
@romainmenke thanks so much for the follow-up! |
Container queries have a syntax nearly identical to media queries, and can replace them in many cases, while adding extra functionality. But as of right now, the custom-media plugin doesn't allow using the defined media queries in
@containerrules.This PR adds causes the plugin to process
@containerat-rules in the same way@mediaat-rules are handledFWIW, container queries are now natively supported in Blink and WebKit, and supported via polyfill in Gecko/Firefox