Created
April 27, 2015 15:39
-
-
Save matthewbeta/8501d2685c40dfcc93b8 to your computer and use it in GitHub Desktop.
Mixin for media queries with .no-mq fallback (for <IE9)
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
@sml-bp: 480px; | |
@med-bp: 720px; | |
@lrg-bp: 970px; | |
.phablet(@rules) { | |
@media screen and (min-width: @sml-bp) { | |
@rules(); | |
} | |
}; | |
.tablet(@rules) { | |
@media screen and (min-width: @med-bp) { | |
@rules(); | |
} | |
}; | |
.desktop(@rules) { | |
@media screen and (min-width: @lrg-bp) { | |
@rules(); | |
} | |
.no-mq & { | |
@rules(); | |
} | |
}; | |
body { | |
background: black; | |
} | |
.phablet ({ | |
body { | |
background: blue; | |
} | |
}); | |
.tablet({ | |
body { | |
background: red; | |
} | |
}); | |
.desktop ({ | |
body { | |
background: yellow; | |
} | |
}); | |
.my-class { | |
color: #FFF; | |
.tablet({ | |
color: #000; | |
}); | |
.desktop({ | |
color: red; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment