Skip to content

Instantly share code, notes, and snippets.

@roytomeij
Last active September 3, 2015 10:07
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 roytomeij/0e548199aabaf01055a3 to your computer and use it in GitHub Desktop.
Save roytomeij/0e548199aabaf01055a3 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin respond($orientation, $media:null) {
$allowed-orientation: portrait, landscape;
$allowed-media: null, mobile, tablet;
@if (
($orientation and index($allowed-orientation, $orientation))
and
index($allowed-media, $media)
){
html.#{if($media, "#{$media}.", "")}#{$orientation} & {
@content;
}
}
@else {
html & {
@content;
}
}
}
.l {
@include respond(landscape) {
color: red;
}
}
.mp {
@include respond(portrait, mobile) {
color: blue;
}
}
.not-allowed-orientation {
@include respond(widescreen) {
color: red;
}
}
html.landscape .l {
color: red;
}
html.mobile.portrait .mp {
color: blue;
}
html .not-allowed-orientation {
color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment