Created
September 23, 2014 07:26
-
-
Save MoOx/f2455fd12c148f55c94a to your computer and use it in GitHub Desktop.
postcss-custom-properties injections for media queries
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
@media screen and (min-width: 320px) { | |
:root { | |
--size: 1em; | |
} | |
@media (min-height: 320px) { | |
:root { | |
--size: 0.5em; | |
} | |
} | |
} | |
:root { | |
--size: 2em; | |
} | |
body { | |
font-size: var(--size); | |
} | |
@media screen and (min-width: 320px) { | |
p { | |
font-size: var(--size); | |
} | |
} |
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
body { | |
font-size: 2em; | |
} | |
@media screen and (min-width: 320px) {body {font-size: 1em;}} | |
@media screen and (min-width: 320px) {@media (min-height: 320px) {body {font-size: 0.5em;}}} | |
@media screen and (min-width: 320px) { | |
p { | |
font-size: 2em; | |
} | |
@media screen and (min-width: 320px) {p {font-size: 1em;}} | |
@media screen and (min-width: 320px) {@media (min-height: 320px) {p {font-size: 0.5em;}}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: nested media queries are valid according to specs & are subject to another plugin to transform it too ;)