-
-
Save ZeeAgency/1333835 to your computer and use it in GitHub Desktop.
generate an inline sprite.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@include "icon/*.png"; | |
#{$icon-sprite-base-class} { | |
background-image: inline-sprite($icon-sprites); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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