Skip to content

Instantly share code, notes, and snippets.

@codekraft-studio
Last active November 17, 2017 13:43
Show Gist options
  • Save codekraft-studio/18d4d1731112fe9f448cd8106a86709d to your computer and use it in GitHub Desktop.
Save codekraft-studio/18d4d1731112fe9f448cd8106a86709d to your computer and use it in GitHub Desktop.
A list of the most used media queries as sass variables.
/**
* Sass-Ready media queries
* Here there are some presets of useful
* media queries breakpoints for various devices
* Usage: @media #{variable-name} { }
* and it will compile to: @media variable-name { }
*
*/
// Devices
$desktops-laptops: "only screen and (min-width : 1224px)";
$large-screens: "only screen and (min-width : 1824px)";
$ipads-both: "only screen and (min-device-width : 768px) and (max-device-width : 1024px)";
$ipads-landscape: "only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape)";
$ipads-portrait: "only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait)";
$iphone-4: "only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5)";
$smartphones-both: "only screen and (min-device-width : 320px) and (max-device-width : 480px)";
$smartphones-landscape: "only screen and (min-width : 321px)";
$smartphones-portrait: "only screen and (max-width : 320px)";
// Pixel Rateos
$ldpi-screens: "screen and (-webkit-device-pixel-ratio: 0.75)";
$mdpi-screens: "screen and (-webkit-device-pixel-ratio: 1.0)";
$hdpi-screens: "screen and (-webkit-device-pixel-ratio: 1.5)";
$retina-screens: "screen and (-webkit-device-pixel-ratio: 2.0)";
// Wearables
$apple-watch: "(max-device-width: 42mm) and (min-device-width: 38mm)";
$moto360-watch: "(max-device-width: 218px) and (max-device-height: 281px)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment