Skip to content

Instantly share code, notes, and snippets.

@ptz0n
Created July 22, 2012 10:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptz0n/3159164 to your computer and use it in GitHub Desktop.
Save ptz0n/3159164 to your computer and use it in GitHub Desktop.
Sass respond to mixin
@mixin respond-to($media) {
@if $media == landscape {
@media screen and (min-width: 321px) { @content; }
}
@else if $media == tablet {
@media only screen and (min-width: 768px) { @content; }
}
@else if $media == desktop {
@media only screen and (min-width: 992px) { @content; }
}
@else if $media == retina {
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment