Skip to content

Instantly share code, notes, and snippets.

@tomrishworth
Last active August 29, 2015 14:05
Show Gist options
  • Save tomrishworth/9dc47886f17c6e091317 to your computer and use it in GitHub Desktop.
Save tomrishworth/9dc47886f17c6e091317 to your computer and use it in GitHub Desktop.
Media Query Mixin
// Media Query Variables
$XS: 580px;
$S: 768px;
$M: 992px;
$L: 1200px;
$XL: 1440px;
// Media Query Mixin
@mixin MQ($canvas){
@if $canvas == XS{
@media only screen and (min-width: $XS) { @content; }
}
@else if $canvas == S{
@media only screen and (min-width: $S) { @content; }
}
@else if $canvas == Sneg{
@media only screen and (max-width: $Sneg - 1) { @content; }
}
@else if $canvas == M{
@media only screen and (min-width: $M) { @content; }
}
@else if $canvas == L{
@media only screen and (min-width: $L) { @content; }
}
@else if $canvas == XL{
@media only screen and (min-width: $XL) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment