尝试将这些行添加到您的config.rb
:
module Compass::SassExtensions::Functions::Sprites
def sprite_url(map)
verify_map(map, "sprite-url")
map.generate
generated_image_url(Sass::Script::String.new(map.name_and_hash))
end
end
module Compass::SassExtensions::Sprites::SpriteMethods
def name_and_hash
"sprite-#{path}.png"
end
def cleanup_old_sprites
Dir[File.join(::Compass.configuration.generated_images_path, "sprite-#{path}.png")].each do |file|
log :remove, file
FileUtils.rm file
::Compass.configuration.run_sprite_removed(file)
end
end
end
module Compass
class << SpriteImporter
def find_all_sprite_map_files(path)
glob = "sprite-*{#{self::VALID_EXTENSIONS.join(",")}}"
Dir.glob(File.join(path, "**", glob))
end
end
end
为我工作Compass 0.12.2 (Alnilam)