From bbdb179df1571e1dae5abdf9bcacadaf99e5d8a3 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Thu, 9 Feb 2012 19:50:20 -0500 Subject: [PATCH] Revert "Merge pull request #712 from Xananax/sprite_background_image" This reverts commit 0c208d58faf4d184b37a0aa020d17e4d774e4c79, reversing changes made to c81af69c69976e02f383b9b9e2820d120549e155. --- lib/compass/sprite_importer/content.erb | 5 +- test/integrations/sprites_test.rb | 94 ++++++++----------------- 2 files changed, 33 insertions(+), 66 deletions(-) diff --git a/lib/compass/sprite_importer/content.erb b/lib/compass/sprite_importer/content.erb index bff7e745..ccc6144e 100644 --- a/lib/compass/sprite_importer/content.erb +++ b/lib/compass/sprite_importer/content.erb @@ -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 @@ -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); -} +} \ No newline at end of file diff --git a/test/integrations/sprites_test.rb b/test/integrations/sprites_test.rb index 6f375a99..3284f995 100644 --- a/test/integrations/sprites_test.rb +++ b/test/integrations/sprites_test.rb @@ -67,8 +67,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -99,8 +98,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -121,8 +119,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -154,8 +151,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -180,8 +176,7 @@ class SpritesTest < Test::Unit::TestCase 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] @@ -195,8 +190,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -218,8 +212,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -242,8 +235,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -266,8 +258,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -289,8 +280,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -308,8 +298,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -326,8 +315,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -365,8 +353,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -393,8 +380,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -418,8 +404,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -438,16 +423,14 @@ class SpritesTest < Test::Unit::TestCase 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 @@ -456,8 +439,7 @@ class SpritesTest < Test::Unit::TestCase @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 @@ -466,15 +448,12 @@ class SpritesTest < Test::Unit::TestCase 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 @@ -493,8 +472,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -514,8 +492,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -540,8 +517,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -568,8 +544,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -598,8 +573,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -617,8 +591,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -655,8 +628,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -727,8 +699,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -751,8 +722,7 @@ class SpritesTest < Test::Unit::TestCase 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 { @@ -778,8 +748,7 @@ class SpritesTest < Test::Unit::TestCase 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; @@ -801,8 +770,7 @@ class SpritesTest < Test::Unit::TestCase 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;