Last active
December 18, 2015 19:29
-
-
Save jpavon/5833682 to your computer and use it in GitHub Desktop.
Element query workaround
This file contains hidden or 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
@mixin elementquery() { | |
@media (min-width: 32.5em) { .content & { @content; } } | |
@media (min-width: 90em) { .aside & { @content; } } | |
} | |
.schedule-component { | |
@include elementquery() { | |
color: pink; | |
} | |
} | |
// Output: | |
@media (min-width: 32.5em) { | |
.content .schedule-component { | |
color: pink; | |
} | |
} | |
@media (min-width: 90em) { | |
.aside .schedule-component { | |
color: pink; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now I see what you mean by passing multiple values through. Check out https://gist.github.com/micahgodbolt/5851228