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 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; | |
} | |
} |
Now I see what you mean by passing multiple values through. Check out https://gist.github.com/micahgodbolt/5851228
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why would the aside .schedule-component need to be in it's own media query? At lower than 90em does it need to be the full version of the schedule?