Created
March 10, 2015 15:56
-
-
Save mejiaj/23975d268017fe106fe5 to your computer and use it in GitHub Desktop.
SCSS Media Queries using maps and a mixin.
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
| /* | |
| * Based on sitepoint article by Hugo Giraudel | |
| * http://www.sitepoint.com/managing-responsive-breakpoints-sass/ | |
| */ | |
| $breakpoints: ( | |
| small: 300/16 + 0em, | |
| medium: 500/16 + 0em, | |
| large: 850/16 + 0em | |
| ); | |
| @mixin mq($breakpoint) { | |
| @if map-has-key($breakpoints, $breakpoint) { | |
| // Goes to $breakpoints map and gets the $breakpoint value | |
| @media only screen and ( min-width: #{map-get( $breakpoints, $breakpoint )} ) { @content; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment