Skip to content

Instantly share code, notes, and snippets.

@ZeeAgency
Forked from chriseppstein/inline_example.scss
Created November 2, 2011 14:56
Show Gist options
  • Save ZeeAgency/1333835 to your computer and use it in GitHub Desktop.
Save ZeeAgency/1333835 to your computer and use it in GitHub Desktop.
generate an inline sprite.
@include "icon/*.png";
#{$icon-sprite-base-class} {
background-image: inline-sprite($icon-sprites);
}
# copy this to your compass config.
module Sass::Script::Functions
def sprite_path(map)
Sass::Script::String.new("#{map.path}-s#{map.uniqueness_hash}.png")
end
declare :sprite_path, [:map]
def inline_sprite(map)
verify_map(map, "sprite-url")
map.generate
inline_image(sprite_path(map))
end
declare :inline_sprite, [:map]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment