Skip to content

Instantly share code, notes, and snippets.

@georgecrawford
Created May 22, 2014 15:06
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 georgecrawford/17dc1a5973b870494ee6 to your computer and use it in GitHub Desktop.
Save georgecrawford/17dc1a5973b870494ee6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
@mixin smallscreen() {
// landscape, width < 599, ensuring device is landscape and not portrait with keyboard open
@media all and (orientation: landscape) and (max-width: 599px) and (min-device-aspect-ratio: 1/1),
// landscape, height < 399, ensuring device is landscape, but not when extra widescreen because keyboard is open
all and (orientation: landscape) and (max-height: 399px) and (min-device-aspect-ratio: 1/1) and (max-aspect-ratio: 3/1),
// portrait, width < 499
all and (orientation: portrait) and (max-width: 499px),
// portrait, height < 599
all and (orientation: portrait) and (max-height: 599px) {
@content;
}
}
@mixin portrait() {
@media all and (orientation: portrait) {
@content;
}
}
.test {
@include smallscreen {
@include portrait {
color: blue;
}
}
}
@media all and (orientation: landscape) and (max-width: 599px) and (min-device-aspect-ratio: 1 / 1) and (orientation: portrait), all and (orientation: landscape) and (max-height: 399px) and (min-device-aspect-ratio: 1 / 1) and (max-aspect-ratio: 3 / 1) and (orientation: portrait), all and (orientation: portrait) and (max-width: 499px) and (orientation: portrait), all and (orientation: portrait) and (max-height: 599px) and (orientation: portrait) {
.test {
color: blue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment