Skip to content

Instantly share code, notes, and snippets.

@ackernaut
Created July 22, 2016 18:45
Show Gist options
  • Save ackernaut/8829417bd1dd7c5d2c1597362605510d to your computer and use it in GitHub Desktop.
Save ackernaut/8829417bd1dd7c5d2c1597362605510d to your computer and use it in GitHub Desktop.
Sass media query for high resolution (with optional min-width version)
// _mq-high-res.scss
@mixin mq-high-res {
@media only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 13/10),
only screen and (min-resolution: 120dpi)
{
@content;
}
}
@mixin mq-high-res-min-width($mq) {
@media only screen and (-webkit-min-device-pixel-ratio: 1.3) and (min-width: $mq),
only screen and (-o-min-device-pixel-ratio: 13/10) and (min-width: $mq),
only screen and (min-resolution: 120dpi) and (min-width: $mq)
{
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment