Skip to content
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

Add Media Queries Ranges #3984

Closed
jonathantneal opened this issue Jan 9, 2018 · 9 comments · Fixed by #6379
Closed

Add Media Queries Ranges #3984

jonathantneal opened this issue Jan 9, 2018 · 9 comments · Fixed by #6379

Comments

@jonathantneal
Copy link

jonathantneal commented Jan 9, 2018

Media Queries Ranges

A syntax for defining media query ranges using ordinary mathematical comparison operators

Example code:

@media (width < 480px) {}

@media (480px <= width < 768px) {}

@media (width >= 768px) {}

Specification: https://www.w3.org/TR/mediaqueries-4/#mq-ranges
Resource: PostCSS Polyfill (https://github.com/postcss/postcss-custom-media)
Resource: cssdb (https://jonathantneal.github.io/css-db/#mediaqueries-mq-ranges)

Suggested ID: mq-ranges or mediaqueries-mq-ranges

@cvrebert
Copy link
Contributor

+1

@ethanresnick
Copy link

This would be very useful, because it's hard to polyfill the < and > operators (without the equals sign). See https://www.w3.org/TR/mediaqueries-4/#example-940c271b. Using fractional pixels, which would be the natural way to polyfill this, apparently causes some bugs: postcss/postcss-media-minmax#14

@Malvoz
Copy link
Contributor

Malvoz commented Feb 4, 2018

+1

@JakoD
Copy link

JakoD commented Dec 12, 2019

+1
Seems to be supported only by Firefox since Version 63 (tested with https://codepen.io/jakod/pen/rNaLjGq)

@Malvoz
Copy link
Contributor

Malvoz commented May 25, 2020

@Schweinepriester
Copy link
Contributor

Available via MDN: https://caniuse.com/mdn-css_at-rules_media_range_syntax

@Schweinepriester
Copy link
Contributor

@Fyrd
Copy link
Owner

Fyrd commented Aug 3, 2022

Now available at https://caniuse.com/css-media-range-syntax (MDN entry should be removed from search results at end of the week)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants