Last active
August 21, 2020 13:59
-
-
Save BryanSchuetz/6ffb1e4f129a55086461 to your computer and use it in GitHub Desktop.
Sass: Media Query 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
$width-tiny: 15em; //4bits | |
$width-small: 30em; //6bits | |
$width-medium: 37.5em; //8bits | |
$width-wide: 57em; //10bits | |
// responsive mixin for bubbled media-querries | |
@mixin responsive($width){ | |
@if $width == tiny-screens{ | |
@media screen and (min-width: $width-tiny){ | |
@content; | |
} | |
} | |
@else if $width == small-screens{ | |
@media screen and (min-width: $width-small){ | |
@content; | |
} | |
} | |
@else if $width == medium-screens{ | |
@media screen and (min-width: $width-medium){ | |
@content; | |
} | |
} | |
@else if $width == wide-screens{ | |
@media screen and (min-width: $width-wide){ | |
@content; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment