Sprites + Text Replacement

129 views
Skip to first unread message

Jesse

unread,
May 17, 2012, 3:07:34 PM5/17/12
to Compass
Hello all,

I'm struggling with finding the best way to replace the text of a link
with a sprite. I'm aware of the sprite-replace-text-with-dimensions()
mixin, but I can't figure out what arguments it requires. I see the
docs call for the map and sprite, but I'm not sure how to get those in
place.

Any help would be appreciated!

Jesse

Chris Eppstein

unread,
May 23, 2012, 11:35:31 AM5/23/12
to compas...@googlegroups.com
If you show me your sprite code, I'll tell you how to do it.

chris


Jesse

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.


Jesse Schutt

unread,
May 23, 2012, 2:50:12 PM5/23/12
to compas...@googlegroups.com
Thanks for responding Chris!  I'm sure that I'm missing something obvious, but here is what I've been using for my sprite code:

@mixin replace($width: false, $height: false) {
@if $width {
width: $width; 
}
@if $height {
height: $height;
}
background-repeat: no-repeat;
text-indent: 100%;
whitespace: nowrap;
display: block;
overflow: hidden;
text-align: left;
direction: ltr;
font-size: 1px;
}

@import "icons/*.png";

a {
  text-decoration: none;
  @include replace(318px, 69px);
  @include icons-sprite(green_header_logo, true);
}

What I would like to do is to be able to replace the text with the sprite, and have the dimensions of the sprite pass through into the replaced text element.

Please pardon my naivety. 

Jesse

Reply all
Reply to author
Forward
0 new messages