fixes #253
This commit is contained in:
parent
a9b6d8cfde
commit
46eec5362d
@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
compass (0.11.beta.3.01b9cd3)
|
||||
compass (0.11.beta.3.a9b6d8c)
|
||||
chunky_png (~> 1.1.0)
|
||||
sass (>= 3.1.0.alpha.249)
|
||||
|
||||
|
@ -55,6 +55,7 @@ module Compass
|
||||
image
|
||||
end
|
||||
end
|
||||
|
||||
# Calculates the overal image dimensions
|
||||
# collects image sizes and input parameters for each sprite
|
||||
def compute_image_positions!
|
||||
|
@ -51,6 +51,10 @@ module Compass
|
||||
Digest::MD5.file(file).hexdigest
|
||||
end
|
||||
|
||||
def mtime
|
||||
File.mtime(file)
|
||||
end
|
||||
|
||||
private
|
||||
def dimensions
|
||||
@dimensions ||= Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(file).size
|
||||
|
@ -440,5 +440,32 @@ describe Compass::Sprites do
|
||||
}
|
||||
CSS
|
||||
end
|
||||
|
||||
it "should calculate corret sprite demsions when givin spacing via issue#253" do
|
||||
css = render <<-SCSS
|
||||
$squares-spacing: 10px;
|
||||
@import "squares/*.png";
|
||||
.foo {
|
||||
@include sprite-background-position($squares-sprites, "twenty-by-twenty");
|
||||
}
|
||||
.bar {
|
||||
@include sprite-background-position($squares-sprites, "ten-by-ten");
|
||||
}
|
||||
SCSS
|
||||
image_size('squares-*.png').should == [20, 40]
|
||||
css.should == <<-CSS
|
||||
.squares-sprite {
|
||||
background: url('/squares-e3c68372d9.png') no-repeat;
|
||||
}
|
||||
|
||||
.foo {
|
||||
background-position: 0 -20px;
|
||||
}
|
||||
|
||||
.bar {
|
||||
background-position: 0 0;
|
||||
}
|
||||
CSS
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user