Created
April 27, 2018 14:45
-
-
Save danbucholtz/be1a69393c2cab22391607751dffed87 to your computer and use it in GitHub Desktop.
CSS Media Query With Variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For example, if a responsive site uses a particular breakpoint in several places, it can alias that with a reasonable name: | |
@custom-media --narrow-window (max-width: 30em); | |
@media (--narrow-window) { | |
/* narrow window styles */ | |
} | |
@media (--narrow-window) and (script) { | |
/* special styles for when script is allowed */ | |
} | |
/* etc */ | |
https://drafts.csswg.org/mediaqueries-5/#custom-mq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment