Skip to content

Instantly share code, notes, and snippets.

@BryanSchuetz
Last active August 21, 2020 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BryanSchuetz/6ffb1e4f129a55086461 to your computer and use it in GitHub Desktop.
Save BryanSchuetz/6ffb1e4f129a55086461 to your computer and use it in GitHub Desktop.
Sass: Media Query Mixin
$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