Skip to content

Instantly share code, notes, and snippets.

@awkale
Created October 29, 2013 15:33
Show Gist options
  • Save awkale/7216943 to your computer and use it in GitHub Desktop.
Save awkale/7216943 to your computer and use it in GitHub Desktop.
retina sprite
// ==========
// = SPRITE =
// ==========
.retina-sprite(@width-1x, @height-1x, @posX-1x, @posY-1x) {
background-image: url(../img/sprite.png);
background-repeat: no-repeat;
background-position: @posX-1x @posY-1x;
width: @width-1x;
height: @height-1x;
// @media
// only screen and (-webkit-min-device-pixel-ratio: 2),
// only screen and ( min--moz-device-pixel-ratio: 2),
// only screen and ( -o-min-device-pixel-ratio: 2/1),
// only screen and ( min-device-pixel-ratio: 2),
// only screen and ( min-resolution: 192dpi),
// only screen and ( min-resolution: 2dppx) {
// background: url(../img/sprite-2x.png) no-repeat @posX-1x*2 @posY-1x*2;
// width: @width-1x;
// height: @height-1x;
// }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment