Improved hide-text mixin performance and accessibility, closes #743

This commit is contained in:
Brandon Mathis 2012-03-05 16:25:49 -06:00
parent 92181e074f
commit f1187ba44e
2 changed files with 9 additions and 11 deletions

View File

@ -26,9 +26,7 @@
// Hides text in an element so you can see the background. // Hides text in an element so you can see the background.
@mixin hide-text { @mixin hide-text {
$approximate_em_value: 12px / 1em; font: 0/0 serif;
$wider_than_any_screen: -9999em; text-shadow: none;
text-indent: $wider_than_any_screen * $approximate_em_value; color: transparent;
overflow: hidden;
text-align: left;
} }

View File

@ -773,18 +773,18 @@ class SpritesTest < Test::Unit::TestCase
background:url('/colors-s58671cb5bb.png') no-repeat; background:url('/colors-s58671cb5bb.png') no-repeat;
} }
.blue { .blue {
text-indent:-119988px; font: 0/0 serif;
overflow:hidden; text-shadow: none;
text-align:left; color: transparent;
background-position:0 0; background-position:0 0;
background-image:url('/colors-s58671cb5bb.png'); background-image:url('/colors-s58671cb5bb.png');
background-repeat:no-repeat; background-repeat:no-repeat;
} }
.yellow { .yellow {
text-indent:-119988px; font: 0/0 serif;
overflow:hidden; text-shadow: none;
text-align:left; color: transparent;
background-position:0 -10px; background-position:0 -10px;
height:10px; height:10px;
width:10px; width:10px;