Created
September 6, 2010 07:34
-
-
Save archan937/566754 to your computer and use it in GitHub Desktop.
Mixins for SASS in combination with Compass and Lemonade to render indented text displayed with a sprite-image (IE6 compatible)
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
=block | |
display: block | |
=clear | |
*display: inline-block | |
&:after | |
content: " " | |
height: 0 | |
+block | |
clear: both | |
visibility: hidden | |
=indent | |
text-indent: -9999px | |
+clear | |
+block | |
=sprite_image(!url) | |
width: image-width(!url) | |
height: image-height(!url) | |
line-height: image-height(!url) | |
background: sprite-image(!url) no-repeat | |
-background: none | |
-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/#{!url}", sizingMethod="scale") | |
=text_image(!url) | |
+sprite_image(!url) | |
+indent |
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
h1.rails_gems | |
+text-image("sprite/text-rails_gems.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it will work. Here are some improvements:
$url
instead of deprecated!url
)Are you using the sprite image as text alternative? If so I would suggest to use typkit or another service for custom fonts.