added boolean functions for finding selectors
This commit is contained in:
parent
46eec5362d
commit
6e1daf69f5
@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
compass (0.11.beta.3.a9b6d8c)
|
compass (0.11.beta.3.46eec53)
|
||||||
chunky_png (~> 1.1.0)
|
chunky_png (~> 1.1.0)
|
||||||
sass (>= 3.1.0.alpha.249)
|
sass (>= 3.1.0.alpha.249)
|
||||||
|
|
||||||
|
@ -70,7 +70,19 @@ module Compass
|
|||||||
def image_for(name)
|
def image_for(name)
|
||||||
@images.detect { |img| img.name == name}
|
@images.detect { |img| img.name == name}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_hover?(name)
|
||||||
|
!image_for("#{name}_hover").nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def has_target?(name)
|
||||||
|
!image_for("#{name}_target").nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def has_active?(name)
|
||||||
|
!image_for("#{name}_active").nil?
|
||||||
|
end
|
||||||
|
|
||||||
def sprite_names
|
def sprite_names
|
||||||
image_names.map{|f| Compass::Sprites.sprite_name(f) }
|
image_names.map{|f| Compass::Sprites.sprite_name(f) }
|
||||||
end
|
end
|
||||||
|
@ -54,7 +54,7 @@ module Compass
|
|||||||
def mtime
|
def mtime
|
||||||
File.mtime(file)
|
File.mtime(file)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def dimensions
|
def dimensions
|
||||||
@dimensions ||= Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(file).size
|
@dimensions ||= Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(file).size
|
||||||
|
0
spec/compass/sass_extensions/sprites/base_spec.rb
Normal file
0
spec/compass/sass_extensions/sprites/base_spec.rb
Normal file
BIN
spec/test_project/public/images/selectors/ten-by-ten.png
Normal file
BIN
spec/test_project/public/images/selectors/ten-by-ten.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
spec/test_project/public/images/selectors/ten-by-ten_active.png
Normal file
BIN
spec/test_project/public/images/selectors/ten-by-ten_active.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
spec/test_project/public/images/selectors/ten-by-ten_hover.png
Normal file
BIN
spec/test_project/public/images/selectors/ten-by-ten_hover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
spec/test_project/public/images/selectors/ten-by-ten_target.png
Normal file
BIN
spec/test_project/public/images/selectors/ten-by-ten_target.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Loading…
Reference in New Issue
Block a user