From c4e7e3c933db27bf82b4190ed9c522bd1850c82f Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 23 Sep 2013 12:46:57 -0700 Subject: [PATCH] deprecate .hide; fixes #10446 --- css.html | 21 ++++++--------------- less/utilities.less | 1 + 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/css.html b/css.html index 013b579c34..7f527084f2 100644 --- a/css.html +++ b/css.html @@ -2332,18 +2332,20 @@ For example, <section> should be wrapped as inline.

Showing and hiding content

-

Force an element to be shown or hidden via display with the use of .show and .hide classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.

+

Force an element to be shown or hidden (including for screen readers) with the use of .show and .hidden classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.

+

.hide is also available, but it does not always affect screen readers and is deprecated as of v3.0.1. Use .hidden or .sr-only instead.

{% highlight html %}
...
-
...
+ {% endhighlight %} {% highlight css %} // Classes .show { display: block !important; } -.hide { +.hidden { display: none !important; + visibility: hidden !important; } // Usage as mixins @@ -2351,23 +2353,12 @@ For example, <section> should be wrapped as inline. .show(); } .another-element { - .hide(); + .hidden(); } {% endhighlight %}

Screen reader content

-

Hide an element everywhere, including screen readers, with .hidden. Can also be used as a mixin.

-{% highlight html %} - -{% endhighlight %} -{% highlight css %} -// Usage as a Mixin -.example { - .hidden(); -} -{% endhighlight %} -

Hide an element to all devices except screen readers with .sr-only. Necessary for following accessibility best practices. Can also be used as a mixin.

{% highlight html %} Skip to content diff --git a/less/utilities.less b/less/utilities.less index fa2d004ae5..ae2ae4be2d 100644 --- a/less/utilities.less +++ b/less/utilities.less @@ -23,6 +23,7 @@ // Toggling content // ------------------------- +// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 .hide { display: none !important; }