Created
January 21, 2015 13:22
-
-
Save jamespantalones/e403ffa368b17bef326d to your computer and use it in GitHub Desktop.
jchambers micro media query
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
// --------------------------------- | |
// Media query breakpoints & mixin | |
// | |
// Usage: | |
// | |
// @include mq("BREAKPOINT_NAME") { //styles } | |
$breakpoints: ( | |
"extra-small" 500px, | |
"small" 700px, | |
"medium" 1047px, | |
"large" 1300px, | |
"extra-large" 1450px, | |
"extra-extra-large" 1800px | |
); | |
@mixin mq($size, $type: "min-width") { | |
@each $breakpoint in $breakpoints { | |
@if ($size == nth($breakpoint, 1)) { | |
@media ($type: nth($breakpoint, 2)) { | |
@content; | |
} | |
} | |
} | |
} | |
.header { | |
// Mobile styles first... | |
padding: 1em; | |
@include mq("medium") { | |
// Add more padding for medium size screens... | |
padding: 2em; | |
} | |
@include mq("large") { | |
// And yet more on large screens | |
padding: 3em; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment