Last active
December 16, 2015 17:59
-
-
Save tsvensen/5474542 to your computer and use it in GitHub Desktop.
Using Media Queries in Sass with ESRG's Sass Grid Generator (https://github.com/dfcb/extra-strength-responsive-grids)
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
// Using media queries in Sass with ESRG Grid Generator (https://github.com/dfcb/extra-strength-responsive-grids) | |
@import 'grid.generator.scss' // (https://github.com/dfcb/extra-strength-responsive-grids/blob/master/css/_grid.generator.scss) | |
// Media query mixin used below (should live in another file) | |
@mixin mq($media_query) { | |
@media ($media_query) { @content; } | |
} | |
// set breakpoints | |
$s-breakpoint: 0; | |
$m-breakpoint: 35em; | |
$l-breakpoint: 55em; | |
// build media queries | |
$S: 'min-width:'+ $s-breakpoint; | |
$M: 'min-width:'+ $m-breakpoint; | |
$L: 'min-width:'+ $l-breakpoint; | |
// generate the grid | |
@include gridGenerator( | |
($s-breakpoint, $m-breakpoint, $l-breakpoint), // breakpoints | |
'em' // breakpoint type 'px' or 'em' | |
); | |
// ...and use the media query variables (see mixin definition above) | |
body { | |
text-decoration: underline; | |
@include mq($L) { | |
text-decoration: blink; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks alright to me. I don't do use gridGenerators, but that looks like a good way to approach that.