Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
Last active December 16, 2015 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2ndkauboy/5397402 to your computer and use it in GitHub Desktop.
Save 2ndkauboy/5397402 to your computer and use it in GitHub Desktop.
A simple mixin to wrap some CSS into a pixel-ration media query
@mixin pixel-ratio($ratio){
@media (-webkit-min-device-pixel-ratio: $ratio), /* Webkit browsers */
(min--moz-device-pixel-ratio: $ratio), /* old Firefox (prior to FF 16) */
(min-resolution: #{$ratio}dppx), /* the standard using dppx */
(min-resolution: #{$ratio * 96}dpi){ /* fallback using dpi */
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment