Skip to content

Instantly share code, notes, and snippets.

@0xjjpa
Created November 28, 2013 12:54
Show Gist options
  • Save 0xjjpa/7691431 to your computer and use it in GitHub Desktop.
Save 0xjjpa/7691431 to your computer and use it in GitHub Desktop.
Media Query Sass Recipe
$break-small: 480px;
$break-large: 1024px;
@mixin media-query-for($device) {
@if $device == palm {
@media only screen and (max-width: $break-small) { @content; }
}
@else if $device == lap {
@media only screen and (min-width: $break-small + 1) and (max-width: $break-large - 1) { @content; }
}
@else if $device == lap-and-up {
@media only screen and (min-width: $break-small + 1) { @content; }
}
@else if $device == portable {
@media only screen and (max-width: $break-large - 1) { @content; }
}
@else if $device == desk {
@media only screen and (min-width: $break-large) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment