Skip to content

Instantly share code, notes, and snippets.

@danielhusar
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielhusar/bd3572f978e392537320 to your computer and use it in GitHub Desktop.
Save danielhusar/bd3572f978e392537320 to your computer and use it in GitHub Desktop.
Nested mixin inside media queries
@mixin query {
@media only screen and (max-width: 8888888px) {
@content;
}
}
@media all and (min-width: 1px) {
body {
color: black;
@media all and (max-width: 999999px) {
color: white;
}
@mixin query {
color: blue;
}
}
}
/**
Outputs:
@media all and (min-width: 1px) {
body {
color: black;
}
}
@media all and (min-width: 1px) and (max-width: 999999px) {
body {
color: white;
}
}
**/
@danielhusar
Copy link
Author

Retina mixin doesn't get outputted and merged with parent media query because only screen have conflict with all.

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