Skip to content

Instantly share code, notes, and snippets.

@lunelson
Created February 10, 2014 12:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunelson/8914969 to your computer and use it in GitHub Desktop.
Save lunelson/8914969 to your computer and use it in GitHub Desktop.
Ref for libsass issue
// ----
// Sass (v3.3.0.rc.3)
// Compass (v1.0.0.alpha.18)
// ----
@mixin hidpi($num, $denom: 1) {
@media
(-webkit-min-device-pixel-ratio: $num/$denom),
(min--moz-device-pixel-ratio: $num/$denom),
(-o-min-device-pixel-ratio: #{$num}/#{$denom}),
(min-device-pixel-ratio: $num/$denom),
(min-resolution: $num/$denom * 96dpi),
(min-resolution: $num/$denom * 1dppx) {
@content;
}
}
.test {
@media only screen and (min-width: 700px) {
@include hidpi(3,2) {
color: red;
}
}
}
@media only screen and (min-width: 700px) and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-width: 700px) and (min--moz-device-pixel-ratio: 1.5), only screen and (min-width: 700px) and (-o-min-device-pixel-ratio: 3 / 2), only screen and (min-width: 700px) and (min-device-pixel-ratio: 1.5), only screen and (min-width: 700px) and (min-resolution: 144dpi), only screen and (min-width: 700px) and (min-resolution: 1.5dppx) {
.test {
color: red; } }
@lunelson
Copy link
Author

written as reference for a libsass issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment