Skip to content

Instantly share code, notes, and snippets.

@ay13
Created November 29, 2012 22:03
Show Gist options
  • Save ay13/4172202 to your computer and use it in GitHub Desktop.
Save ay13/4172202 to your computer and use it in GitHub Desktop.
sass/compass mixin for returning background path, background position, width and height
@mixin sprite_url_height_width($sprite_name, $image_name) {
background: sprite($sprite_name, $image_name) no-repeat;
width: image-width(sprite-file($sprite_name, $image_name));
height: image-height(sprite-file($sprite_name, $image_name));
}
$sprite_name: sprite-map('folder/*.png', $spacing: 20px);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment