Skip to content


Subversion checkout URL

You can clone with
Download ZIP


sprite: offset-y can take % now #1014

wants to merge 2 commits into from

6 participants


can you update the test cases also?


I have not had time to write tests... I will do my best too soon.


Would like to see this commit merged


Awaiting tests before merging


So this is still a work in progress right?


Would love to see this merged.

@scottdavis scottdavis was assigned

This has languished long enough. @scottdavis, can you either accept this patch and add some tests or reject it, please?


I've reopened the feature request. I'm closing this PR because there's been too much change since it was initially submitted. Sorry, We're going to do better going forward. Hopefully, someone can resubmit the change against 1.0. Features should be submitted to the master branch, bug fixes to the stable branch.


Should be on top of the changes coming in #1771.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 6, 2012
  1. @JaredSartin
Commits on Jan 21, 2013
  1. @JaredSartin
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/compass/sass_extensions/functions/sprites.rb
8 lib/compass/sass_extensions/functions/sprites.rb
@@ -161,8 +161,12 @@ def sprite_position(map, sprite = nil, offset_x = ZERO, offset_y = ZERO)
x = offset_x.value - image.left
x =, x == 0 ? [] : ["px"])
- y = offset_y.value -
- y =, y == 0 ? [] : ["px"])
+ if offset_y.unit_str == "%"
+ y = offset_y
+ else
+ y = offset_y.value -
+ y =, y == 0 ? [] : ["px"])
+ end[x, y],:space)
Sass::Script::Functions.declare :sprite_position, [:map]
Something went wrong with that request. Please try again.