Skip to content

Commit

Permalink
Revert "Merge pull request Compass#866 from kwliou/stable"
Browse files Browse the repository at this point in the history
This reverts commit f562f48, reversing
changes made to 237853a.

This merge broke the code and once fixing that, the tests didn't pass.
  • Loading branch information
chriseppstein committed Jun 23, 2012
1 parent f322cdb commit e73ba1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
17 changes: 0 additions & 17 deletions lib/compass/sass_extensions/functions/sprites.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,6 @@ def sprite_image(*args)
raise Sass::SyntaxError, %Q(The sprite-image() function has been replaced by sprite(). See https://compass-style.org/help/tutorials/spriting/ for more information.)
end

# Returns the position of the sprite in the sprite map specified by $<map>-<sprite>-position
# This can be useful for automatically adjusting the background-position property
def sprite_image_position(map, sprite)
verify_map(map, "sprite-image-position")
sprite = convert_sprite_name(sprite)
unless sprite && sprite.is_a?(Sass::Script::String)
raise Sass::SyntaxError, %Q(The second argument to sprite-image-position must be a sprite name.)
end
image = map.image_for(sprite.value)
unless image
missing_image!(map, sprite)
end
image.position
end
Sass::Script::Functions.declare :sprite_image_position, [:map, :sprite]
end

protected

def reversed_color_names
Expand Down
23 changes: 0 additions & 23 deletions test/integrations/sprites_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -840,27 +840,4 @@ def clean(string)

end

it "should use the image position of the sprite in the sprite map" do
css = render <<-SCSS
$squares-position: 100%;
@import "squares/*.png";
.adjusted-ten {
@include squares-sprite("ten-by-ten", $offset-x: sprite-image-position($square-sprites, "ten-by-ten"));
}
.adjusted-twenty {
@include squares-sprite("twenty-by-twenty", $offset-x: sprite-image-position($square-sprites, "twenty-by-twenty"));
}
SCSS
other_css = <<-CSS
.adjusted-ten {
background-position: 100% 0;
}
.adjusted-twenty {
background-position: 100% -20px;
}
CSS
assert_correct clean(css), clean(other_css)
end

end

0 comments on commit e73ba1d

Please sign in to comment.