Skip to content

Commit

Permalink
Revert "Merge pull request Compass#712 from Xananax/sprite_background…
Browse files Browse the repository at this point in the history
…_image"

This reverts commit 0c208d5, reversing
changes made to c81af69.
  • Loading branch information
scottdavis committed Feb 10, 2012
1 parent 0c208d5 commit bbdb179
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 66 deletions.
5 changes: 2 additions & 3 deletions lib/compass/sprite_importer/content.erb
Expand Up @@ -42,8 +42,7 @@ $<%= name %>-inline: false !default;
}
} @else {
#{$<%= name %>-sprite-base-class} {
background-image: $<%= name %>-sprites;
background-repeat: no-repeat;
background: $<%= name %>-sprites no-repeat;
}
}
//sass functions to return the dimensions of a sprite image as units
Expand Down Expand Up @@ -79,4 +78,4 @@ $<%= name %>-inline: false !default;
// Generates a class for each sprited image.
@mixin all-<%= name %>-sprites($dimensions: $<%= name %>-sprite-dimensions, $prefix: sprite-map-name($<%= name %>-sprites), $offset-x: 0, $offset-y: 0) {
@include <%= name %>-sprites(<%= sprite_names.join(" ") %>, $dimensions, $prefix, $offset-x, $offset-y);
}
}
94 changes: 31 additions & 63 deletions test/integrations/sprites_test.rb
Expand Up @@ -67,8 +67,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/squares-sbbc18e2129.png') no-repeat;
}
.squares-ten-by-ten {
Expand Down Expand Up @@ -99,8 +98,7 @@ def clean(string)
assert_not_nil Dir.glob("#{@generated_images_tmp_path}/squares-s*.png").first
assert_correct <<-CSS, css
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/images/generated/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/images/generated/squares-sbbc18e2129.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -121,8 +119,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/squares-sbbc18e2129.png') no-repeat;
}
.squares-ten-by-ten {
Expand Down Expand Up @@ -154,8 +151,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .cubicle, .large-cube {
background-image: url('/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/squares-sbbc18e2129.png') no-repeat;
}
.cubicle {
Expand All @@ -180,8 +176,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.circles {
background-image: url('/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/squares-sbbc18e2129.png') no-repeat;
}
CSS
assert_equal image_size('squares-s*.png'), [20, 30]
Expand All @@ -195,8 +190,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-s563a5e0855.png');
background-repeat: no-repeat;
background: url('/squares-s563a5e0855.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -218,8 +212,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-s4ea353fa6d.png');
background-repeat: no-repeat;
background: url('/squares-s4ea353fa6d.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -242,8 +235,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-sf4771cb124.png');
background-repeat: no-repeat;
background: url('/squares-sf4771cb124.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -266,8 +258,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-sc82d6f3cf4.png');
background-repeat: no-repeat;
background: url('/squares-sc82d6f3cf4.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -289,8 +280,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-s2f4aa65dcf.png');
background-repeat: no-repeat;
background: url('/squares-s2f4aa65dcf.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -308,8 +298,7 @@ def clean(string)
css = render <<-SCSS
$squares: sprite-map("squares/*.png", $position: 100%);
.squares-sprite {
background-image: $squares;
background-repeat: no-repeat;
background: $squares no-repeat;
}
.adjusted-percentage {
Expand All @@ -326,8 +315,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite {
background-image: url('/squares-sce5dc30797.png');
background-repeat: no-repeat;
background: url('/squares-sce5dc30797.png') no-repeat;
}
.adjusted-percentage {
Expand Down Expand Up @@ -365,8 +353,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .adjusted-percentage, .adjusted-px-1, .adjusted-px-2 {
background-image: url('/squares-sce5dc30797.png');
background-repeat: no-repeat;
background: url('/squares-sce5dc30797.png') no-repeat;
}
.adjusted-percentage {
Expand All @@ -393,8 +380,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-s65c43cd573.png');
background-repeat: no-repeat;
background: url('/squares-s65c43cd573.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -418,8 +404,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
background-image: url('/squares-sb9d9a8ca6a.png');
background-repeat: no-repeat;
background: url('/squares-sb9d9a8ca6a.png') no-repeat;
}
.squares-ten-by-ten {
Expand All @@ -438,16 +423,14 @@ def clean(string)
assert_raise(Sass::SyntaxError) do
render <<-SCSS
.squares {
background-image: sprite-url("squares/*.png");
background-repeat: no-repeat;
background: sprite-url("squares/*.png") no-repeat;
}
SCSS
end
assert_raise(Sass::SyntaxError) do
css = render <<-SCSS
.squares {
background-image: sprite-image("squares/twenty-by-twenty.png");
background-repeat: no-repeat;
background: sprite-image("squares/twenty-by-twenty.png") no-repeat;
}
SCSS
end
Expand All @@ -456,8 +439,7 @@ def clean(string)
@import "squares/*.png";
.squares {
background-image: sprite-position("squares/twenty-by-twenty.png");
background-repeat: no-repeat;
background: sprite-position("squares/twenty-by-twenty.png") no-repeat;
}
SCSS
end
Expand All @@ -466,15 +448,12 @@ def clean(string)
it "should work even if @import is missing" do
css = render <<-SCSS
.squares {
background-image: sprite(sprite-map("squares/*.png"), twenty-by-twenty);
background-repeat: no-repeat;
background: sprite(sprite-map("squares/*.png"), twenty-by-twenty) no-repeat;
}
SCSS
assert_correct css, <<-CSS
.squares {
background-image: url('/squares-sd817b59156.png');
background-position: 0 -10px;
background-repeat: no-repeat;
background: url('/squares-sd817b59156.png') 0 -10px no-repeat;
}
CSS
end
Expand All @@ -493,8 +472,7 @@ def clean(string)
assert_equal image_size('squares-s*.png'), [20, 40]
assert_correct css, <<-CSS
.squares-sprite {
background-image: url('/squares-s555875d730.png');
background-repeat: no-repeat;
background: url('/squares-s555875d730.png') no-repeat;
}
.foo {
Expand All @@ -514,8 +492,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.selectors-sprite, .selectors-ten-by-ten {
background-image: url('/selectors-s7e84acb3d2.png');
background-repeat: no-repeat;
background: url('/selectors-s7e84acb3d2.png') no-repeat;
}
.selectors-ten-by-ten {
Expand All @@ -540,8 +517,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.selectors-sprite, .selectors-ten-by-ten {
background-image: url('/selectors-s7e84acb3d2.png');
background-repeat: no-repeat;
background: url('/selectors-s7e84acb3d2.png') no-repeat;
}
.selectors-ten-by-ten {
Expand All @@ -568,8 +544,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.selectors-sprite, a {
background-image: url('/selectors-s7e84acb3d2.png');
background-repeat: no-repeat;
background: url('/selectors-s7e84acb3d2.png') no-repeat;
}
a {
Expand Down Expand Up @@ -598,8 +573,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.selectors-sprite, a {
background-image: url('/selectors-s7e84acb3d2.png')
background-repeat: no-repeat;
background: url('/selectors-s7e84acb3d2.png') no-repeat;
}
a {
Expand All @@ -617,8 +591,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.selectors-sprite, a {
background-image: url('/selectors-s7e84acb3d2.png')
background-repeat: no-repeat;
background: url('/selectors-s7e84acb3d2.png') no-repeat;
}
a {
Expand Down Expand Up @@ -655,8 +628,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.ko-sprite, .ko-default_background, .ko-starbg26x27 {
background-image: url('/ko-sd46dfbab4f.png')
background-repeat: no-repeat;
background: url('/ko-sd46dfbab4f.png') no-repeat;
}
.ko-default_background {
Expand Down Expand Up @@ -727,8 +699,7 @@ def clean(string)
SCSS
assert_correct css, <<-CSS
.nested-sprite, .nested-ten-by-ten {
background-image: url('/nested-s7b93e0b6bf.png');
background-repeat: no-repeat;
background: url('/nested-s7b93e0b6bf.png') no-repeat;
}
.nested-ten-by-ten {
Expand All @@ -751,8 +722,7 @@ def clean(string)
assert_equal [30, 20], image_size('squares-s*.png')
other_css = <<-CSS
.squares-sprite {
background-image: url('/squares-s4bd95c5c56.png');
background-repeat: no-repeat;
background: url('/squares-s4bd95c5c56.png') no-repeat;
}
.foo {
Expand All @@ -778,8 +748,7 @@ def clean(string)
SCSS
other_css = <<-CSS
.squares-sprite {
background-image: url('/squares-sbbc18e2129.png');
background-repeat: no-repeat;
background: url('/squares-sbbc18e2129.png') no-repeat;
}
.div {
height:21px;
Expand All @@ -801,8 +770,7 @@ def clean(string)
SCSS
other_css = <<-CSS
.colors-sprite {
background-image:url('/colors-s58671cb5bb.png');
background-repeat: no-repeat;
background:url('/colors-s58671cb5bb.png') no-repeat;
}
.blue {
text-indent:-119988px;
Expand Down

0 comments on commit bbdb179

Please sign in to comment.