Created
February 14, 2018 10:59
-
-
Save murger/7cbc4ff7307521448a29cdfd76a04b9f to your computer and use it in GitHub Desktop.
@media mixin
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
$breakpoints: ( | |
tiny: 320px, | |
x-small: 640px, | |
small: 768px, | |
medium: 1024px, | |
large: 1280px, | |
x-large: 1440px, | |
); | |
@mixin media($rule, $bp) { | |
@if (map-has-key($breakpoints, $bp)) { | |
@media (#{$rule}-width: map-get($breakpoints, $bp)) { @content; } | |
} @else { | |
@warn 'Breakpoints supported: ' + map-keys($breakpoints); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment