Created
October 7, 2011 01:36
-
-
Save Rocketpilot/1269229 to your computer and use it in GitHub Desktop.
Global offset of sprites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I'd hoped I could use something like this to globally offset the vertical position of sprites when I use them to badge the left-hand site of heading text. Right now, each sprite defaults to the very top of the containing box and doesn't line up neatly with lower case text: | |
* Heading | |
body text | |
etc. | |
*/ | |
sprite-background-position($map, $sprite, $offset-x, $offset-y) |
Oh, wait, now I see what it's doing:
primary_content header h3 {
background-position: 0 2px;
background-position: 0 -30px;
background-position: 0 -62px;
background-position: 0 -94px;
background-position: 0 -126px;
background-position: 0 -158px;
background-position: 0 -190px;
background-position: 0 -222px;
background-position: 0 -254px;
background-position: 0 -286px;
}
I'm doing something wrong in the way I call the function, clearly.
Right, got it to work. For the record:
@each $sprite in apply, bookings, buy, down, questions, report, reset_password, resources, statuses, up {
h3.icons-#{$sprite} {@include icons-sprite-position($sprite, 0px, 2px); }
}
produced what I'm looking for.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nuts. That only seems to apply the last icon in the list to the headings. Tried comma-delimiting, wrapping in quotes, with & without the parenthesis.
Can't find where it changes the actual CSS output, either, which is spooky, even though the rendered page does actually change.