Skip to content

Instantly share code, notes, and snippets.

@jpgninja
Created January 26, 2017 02:15
Show Gist options
  • Save jpgninja/5c28af17ec8dd4818db900a8e90e3e0d to your computer and use it in GitHub Desktop.
Save jpgninja/5c28af17ec8dd4818db900a8e90e3e0d to your computer and use it in GitHub Desktop.
/* Breakpoints */
/* ------------------------- Source: http://blog.scur.pl/2012/06/variable-media-queries-less-css/ */
@highdensity: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)",
~"only screen and (min--moz-device-pixel-ratio: 1.5)",
~"only screen and (-o-min-device-pixel-ratio: 3/2)",
~"only screen and (min-device-pixel-ratio: 1.5)";
@mobile: ~"only screen and (max-width: 529px)";
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)";
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)";
@desktop-xl: ~"only screen and (min-width: 1129px)";
/* Usage */
section, div, span {
@media @mobile {
background: orange;
}
@media @tablet {
background: purple;
}
@media @desktop {
background: green;
}
@media @desktop-xl {
background: blue;
}
@media @desktop, @desktop-xl {
color: black;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment