Skip to content

Instantly share code, notes, and snippets.

@mattvague
Created May 1, 2013 18:44
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 mattvague/5497342 to your computer and use it in GitHub Desktop.
Save mattvague/5497342 to your computer and use it in GitHub Desktop.
// Retina helper mixins for Compass
// http://www.joelambert.co.uk
//
// Copyright 2012, Joe Lambert.
// Free to use under the MIT license.
// http://joelambert.mit-license.org/
// Inline for standard / URL for retina
=inline-background-image-retina($image)
background-image: asset-data-uri($image)
@if file_exists(retina_filename($image))
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-webkit-min-device-pixel-ratio: 1.75)
@include background-size(image-width($image) auto)
background-image: image-url(retina_filename($image))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment