From eb74d8c86399d41673b9aa0052c70582b13bd714 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Tue, 4 Nov 2014 10:39:54 +0000 Subject: [PATCH] Accessibility tweaks and explanation for glyphicons - add aria-hidden="true" to avoid SRs unintentionally reading out the Unicode character (see http://www.filamentgroup.com/lab/bulletproof_icon_fonts.html) - callout with advice on accessible icon usage - replaced sr-only text in examples with (in the case of button) cleaner aria-label - additional example of icon used to convey meaning (in a non-interactive control) --- docs/_includes/components/glyphicons.html | 47 +++++++++++++++++------ 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/docs/_includes/components/glyphicons.html b/docs/_includes/components/glyphicons.html index c614103c63..b5f5178df3 100644 --- a/docs/_includes/components/glyphicons.html +++ b/docs/_includes/components/glyphicons.html @@ -7,7 +7,7 @@

Use whatever option best suits your specific development setup.

+
+

Accessible icons

+

Modern versions of assistive technologies will announce CSS generated content, as well as specific Unicode characters. To avoid unintended and confusing output in screen readers (particularly when icons are used purely for decoration), we hide them with the aria-hidden="true" attribute.

+

If you're using an icon to convey meaning (rather than only as a decorative element), ensure that this meaning is also conveyed to assistive technologies – for instance, include additional content, visually hidden with the .sr-only class.

+

If you're creating controls with no other text (such as a <button> that only contains an icon), you should always provide alternative content to identify the purpose of the control, so that it will make sense to users of assistive technologies. In this case, you could add an aria-label attribute on the control itself.

+
{% highlight html %} - + {% endhighlight %} @@ -45,22 +51,41 @@
{% highlight html %} + + +{% endhighlight %} +

An icon used in an alert to convey that it's an error message, with additional .sr-only text to convey this hint to users of assistive technologies.

+
+ +
+{% highlight html %} + {% endhighlight %}