Skip to content

Instantly share code, notes, and snippets.

@bernardodiasc
Created February 27, 2014 10:06
Show Gist options
  • Save bernardodiasc/9247437 to your computer and use it in GitHub Desktop.
Save bernardodiasc/9247437 to your computer and use it in GitHub Desktop.
// No media query is the first breakpoint.
// Updates for small tablets and smartphones in landscape
@smalltablet: ~"(min-width: 500px)";
// Updates for tablets in portrait
@tablet: ~"(min-width: 768px)";
// Updates for tablets in landscape and desktop
@desktop: ~"(min-width: 1024px)";
// Fixed-width layout for large screens
@large: ~"(min-width: 1400px)";
// High resolution screens e.g. Retina
@retina: ~"(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)";
// Usage
.class {
color: red;
@media @smalltablet {
color: blue;
}
}
.another-class {
background: black;
@media @smalltablet {
background: purple;
}
@media @desktop {
background: blue;
}
.inside-class {
display: none;
@media @desktop {
display: block;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment