Skip to content

Instantly share code, notes, and snippets.

@idan
Created June 9, 2013 23:50
Show Gist options
  • Save idan/5745775 to your computer and use it in GitHub Desktop.
Save idan/5745775 to your computer and use it in GitHub Desktop.
Responsive SCSS Mixins
@mixin linear {
@media screen and (max-width: 45em) {
@content;
}
}
@mixin mobile-landscape {
@media screen and (max-width: 30em) {
@content;
}
}
@mixin mobile-portrait {
@media screen and (max-width: 20em) {
@content;
}
}
@mixin tight {
@media screen and (min-width: 30em) and (max-width: 60em) {
@content;
}
}
@mixin full {
@media screen and (min-width: 62em) {
@content;
}
}
@mixin short {
@media screen and (max-height: 30em) {
@content;
}
}
@mixin retina {
@media only screen and (-webkit-min-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