Created
February 15, 2019 09:16
-
-
Save aaroniker/421edafbdb19d7ab00d8850da3158381 to your computer and use it in GitHub Desktop.
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
$breakpoints: ( | |
xs: 576px, | |
sm: 768px, | |
md: 992px, | |
lg: 1200px | |
); | |
@mixin min($breakpoint) { | |
@if map-has-key($breakpoints, $breakpoint) { | |
@media (min-width: map-get($breakpoints, $breakpoint)) { | |
@content; | |
} | |
} @else { | |
@media(min-width: $breakpoint) { | |
@content; | |
} | |
} | |
} | |
@mixin max($breakpoint) { | |
@if map-has-key($breakpoints, $breakpoint) { | |
@media(max-width: map-get($breakpoints, $breakpoint) - 1) { | |
@content; | |
} | |
} @else { | |
@media(max-width: $breakpoint) { | |
@content; | |
} | |
} | |
} | |
//Usage | |
@include min(xs|sm|md|lg|Xpx) { //CSS } | |
@include max(xs|sm|md|lg|Xpx) { //CSS } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment