Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10076: Document hide text #10100

Merged
merged 3 commits into from
Aug 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _includes/nav-css.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<li><a href="#helper-classes-floats">Quick floats</a></li>
<li><a href="#helper-classes-clearfix">Clearfix</a></li>
<li><a href="#helper-classes-screen-readers">Screen reader content</a></li>
<li><a href="#helper-classes-image-replacement">Image replacement</a></li>
</ul>
</li>
<li>
Expand Down
12 changes: 12 additions & 0 deletions css.html
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,18 @@ <h3 id="helper-classes-screen-readers">Screen reader content</h3>
}
{% endhighlight %}


<h3 id="helper-classes-image-replacement">Image replacement</h3>
<p>Utilize the <code>.text-hide</code> class or mixin to help replace an element's text content with a background image.</p>
{% highlight html %}
<h1 class="text-hide">Custom heading</h1>
{% endhighlight %}
{% highlight css %}
// Usage as a Mixin
.heading {
.text-hide();
}
{% endhighlight %}
</div>


Expand Down
16 changes: 16 additions & 0 deletions less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,30 @@
}

// CSS image replacement
//
// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
// mixins being reused as classes with the same name, this doesn't hold up. As
// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
// that we cannot chain the mixins together in Less, so they are repeated.
//
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757

// Deprecated as of v3.0.1 (will be removed in v4)
.hide-text() {
font: ~"0/0" a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
// New mixin to use as of v3.0.1
.text-hide() {
font: ~"0/0" a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}



Expand Down
2 changes: 1 addition & 1 deletion less/utilities.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
visibility: hidden;
}
.text-hide {
.hide-text();
.text-hide();
}


Expand Down