fixes issue #602
This commit is contained in:
parent
eb10566e02
commit
f458519e01
@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
compass (0.12.alpha.0.a00044c)
|
||||
compass (0.12.alpha.0.eb10566)
|
||||
chunky_png (~> 1.2)
|
||||
fssm (>= 0.2.7)
|
||||
sass (~> 3.1)
|
||||
|
@ -153,10 +153,14 @@ module Compass::SassExtensions::Functions::Sprites
|
||||
protected
|
||||
|
||||
def convert_sprite_name(sprite)
|
||||
if sprite.is_a?(Sass::Script::Color)
|
||||
return Sass::Script::String.new(Sass::Script::Color::HTML4_COLORS_REVERSE[sprite.rgb])
|
||||
case sprite
|
||||
when Sass::Script::Color
|
||||
Sass::Script::String.new(Sass::Script::Color::HTML4_COLORS_REVERSE[sprite.rgb])
|
||||
when Sass::Script::Bool
|
||||
Sass::Script::String.new(sprite.to_s)
|
||||
else
|
||||
sprite
|
||||
end
|
||||
sprite
|
||||
end
|
||||
|
||||
def verify_map(map, error = "sprite")
|
||||
|
@ -664,6 +664,20 @@ class SpritesTest < Test::Unit::TestCase
|
||||
assert_equal 2, map_files('selectors-s*.png').size, "File was removed"
|
||||
end
|
||||
|
||||
it "should generate a sprite if the sprite is a bool" do
|
||||
css = render <<-SCSS
|
||||
@import "bool/*.png";
|
||||
a {
|
||||
@include bool-sprite(false);
|
||||
}
|
||||
a {
|
||||
@include bool-sprite(true);
|
||||
}
|
||||
SCSS
|
||||
assert !css.empty?
|
||||
end
|
||||
|
||||
|
||||
it "should generate a sprite if the sprite is a colorname" do
|
||||
css = render <<-SCSS
|
||||
@import "colors/*.png";
|
||||
|
Loading…
Reference in New Issue
Block a user