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.
@mixin hide-text {
$approximate_em_value: 12px / 1em;
$wider_than_any_screen: -9999em;
text-indent: $wider_than_any_screen * $approximate_em_value;
overflow: hidden;
text-align: left;
font: 0/0 serif;
text-shadow: none;
color: transparent;
}

View File

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