Created
October 17, 2012 07:30
-
-
Save mkdynamic/3904226 to your computer and use it in GitHub Desktop.
SASS media query helper for iOS devices
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
@mixin respond-to($media) { | |
@if $media == iphone { | |
@media only screen and (device-width: 320px) and (device-height: 480px) { @content; } | |
} | |
@else if $media == iphone-portrait { | |
@media only screen and (device-width: 320px) and (device-height: 480px) and (orientation: portrait) { @content; } | |
} | |
@else if $media == iphone-landscape { | |
@media only screen and (device-width: 320px) and (device-height: 480px) and (orientation: landscape) { @content; } | |
} | |
@else if $media == ipad { | |
@media only screen and (device-width: 768px) and (device-height: 1024px) { @content; } | |
} | |
@else if $media == ipad-portrait { | |
@media only screen and (device-width: 768px) and (device-height: 1024px) and (orientation: portrait) { @content; } | |
} | |
@else if $media == ipad-landscape { | |
@media only screen and (device-width: 768px) and (device-height: 1024px) and (orientation: landscape) { @content; } | |
} | |
@else if $media == ios { | |
@media only screen and (device-width: 768px) and (device-height: 1024px) { @content; } | |
@media only screen and (device-width: 320px) and (device-height: 480px) { @content; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment