fixes #253
This commit is contained in:
parent
a9b6d8cfde
commit
46eec5362d
@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
compass (0.11.beta.3.01b9cd3)
|
compass (0.11.beta.3.a9b6d8c)
|
||||||
chunky_png (~> 1.1.0)
|
chunky_png (~> 1.1.0)
|
||||||
sass (>= 3.1.0.alpha.249)
|
sass (>= 3.1.0.alpha.249)
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ module Compass
|
|||||||
image
|
image
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculates the overal image dimensions
|
# Calculates the overal image dimensions
|
||||||
# collects image sizes and input parameters for each sprite
|
# collects image sizes and input parameters for each sprite
|
||||||
def compute_image_positions!
|
def compute_image_positions!
|
||||||
|
@ -51,6 +51,10 @@ module Compass
|
|||||||
Digest::MD5.file(file).hexdigest
|
Digest::MD5.file(file).hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mtime
|
||||||
|
File.mtime(file)
|
||||||
|
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
|
||||||
|
@ -440,5 +440,32 @@ describe Compass::Sprites do
|
|||||||
}
|
}
|
||||||
CSS
|
CSS
|
||||||
end
|
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
|
end
|
Loading…
Reference in New Issue
Block a user