Created
April 6, 2018 13:38
-
-
Save razwan/59dd3e9ae5715eedbfad042a10bc1836 to your computer and use it in GitHub Desktop.
Media query sass 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
$breakpoints: ( | |
xsmall: 30em, // ~ 480px | |
small: 42.5em, // ~ 680px | |
pad: 50em, // ~ 800px | |
lap: 62.5em, // ~ 1000px | |
desk: 80em // ~ 1280px | |
) !default; | |
@mixin above($bpname) { | |
$breakpoint: map-get($breakpoints, $bpname); | |
@if $breakpoint == null { | |
$breakpoint: $bpname; | |
} | |
@media only screen and (min-width: $breakpoint) { | |
@content; | |
} | |
} | |
@mixin below($bpname) { | |
$breakpoint: map-get($breakpoints, $bpname); | |
@if $breakpoint == null { | |
$breakpoint: $bpname; | |
} | |
@media not screen and (min-width: $breakpoint) { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment