Skip to content

Instantly share code, notes, and snippets.

@miller18
Forked from nickawalsh/icons.sass
Created July 26, 2013 19:31
Show Gist options
  • Save miller18/6091612 to your computer and use it in GitHub Desktop.
Save miller18/6091612 to your computer and use it in GitHub Desktop.
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd
+background-size(image-width(sprite-path($icons)) auto)
@each $icon in sprite_names($icons)
.icn-#{$icon}
+sprite-dimensions($icons, $icon)
background-position: sprite-position($icons, $icon)
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
$offset: nth(sprite-position($icons-hd, $icon), 2) / 2
background-position: 0 $offset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment