mirror of
https://github.com/ForkAwesome/Fork-Awesome.git
synced 2024-12-25 21:11:32 +08:00
336 lines
22 KiB
HTML
336 lines
22 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Basic Page Needs
|
|
================================================== -->
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<meta name="description" content="Fork Awesome, a fork of the iconic font and CSS framework">
|
|
<meta name="author" content="Dave Gandy">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<link rel="shortcut icon" href="../assets/ico/favicon.ico">
|
|
|
|
<title>Fork Awesome & Accessibility</title>
|
|
|
|
<!-- CSS
|
|
================================================== -->
|
|
<link rel="stylesheet" href="../assets/css/site.css">
|
|
<link rel="stylesheet" href="../assets/css/pygments.css">
|
|
<link rel="stylesheet" href="../assets/css/share.min.css">
|
|
<link rel="stylesheet" href="../assets/fork-awesome/css/fork-awesome.css">
|
|
|
|
<!-- Twitter
|
|
================================================== -->
|
|
<meta name="twitter:title" content="Fork Awesome & Accessibility">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:description" content="Fork Awesome, a fork of the iconic font and CSS toolkit">
|
|
<meta name="twitter:image" content="https://forkawesome.github.io/Fork-Awesome/assets/images/banner.jpg">
|
|
|
|
<!-- FACEBOOK
|
|
================================================== -->
|
|
<meta property="og:url" content="https://forkawesome.github.io/Fork-Awesome/">
|
|
<meta property="og:title" content="Fork Awesome & Accessibility">
|
|
<meta name="description" property="og:description" content="Fork Awesome, a fork of the iconic font and CSS toolkit" />
|
|
<meta property="og:image" content="https://forkawesome.github.io/Fork-Awesome/assets/images/banner.jpg">
|
|
|
|
<!--[if lt IE 9]>
|
|
<script src="../assets/js/html5shiv.js"></script>
|
|
<script src="../assets/js/respond.min.js"></script>
|
|
<![endif]-->
|
|
|
|
</head>
|
|
<body class="font-awesome v-accessibility">
|
|
<div id="wrap"> <!-- necessary for sticky footer. wrap all content except footer -->
|
|
<div class="navbar navbar-inverse navbar-static-top hidden-print">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
|
<i class="fa fa-bars fa-lg" aria-hidden="true" title="Toggle navigation"></i>
|
|
<span class="sr-only">Toggle navigation</span>
|
|
</button>
|
|
<a class="navbar-brand" href="../"><i class="fa fa-fork-awesome" aria-hidden="true"></i> Fork Awesome</a>
|
|
</div>
|
|
|
|
<div class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li class="hidden-sm "><a href="../">Home</a></li>
|
|
<li class="hidden-sm">
|
|
<a href="../whats-new/">What's New</a>
|
|
</li>
|
|
<li class="hidden-xs hidden-md hidden-lg">
|
|
<a href="../whats-new/">New</a>
|
|
</li>
|
|
|
|
<li class="hidden-sm"><a href="../get-started/">Get Started</a></li>
|
|
<li class="hidden-xs hidden-md hidden-lg">
|
|
<a href="../get-started/">Start</a>
|
|
</li>
|
|
|
|
<li class="dropdown-split-left"><a href="../icons/">Icons</a></li>
|
|
<li class="dropdown dropdown-split-right hidden-xs">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
<i class="fa fa-caret-down" aria-hidden="true" title="Toggle dropdown menu"></i>
|
|
<span class="sr-only">Toggle dropdown menu</span>
|
|
<span class="toggle drop down"></span>
|
|
</a>
|
|
<ul class="dropdown-menu pull-right">
|
|
<li><a href="../icons/"><i class="fa fa-flag fa-fw" aria-hidden="true"></i> All Icons</a></li>
|
|
<li class="divider"></li>
|
|
<li><a href="../icons/#new"><i class="fa fa-handshake-o fa-fw" aria-hidden="true"></i> New Icons in 4.7</a></li>
|
|
<li><a href="../icons/#web-application"><i class="fa fa-camera-retro fa-fw" aria-hidden="true"></i> Web Application Icons</a></li>
|
|
<li><a href="../icons/#accessibility"><i class="fa fa-universal-access fa-fw" aria-hidden="true"></i> Accessibility Icons</a></li>
|
|
<li><a href="../icons/#hand"><i class="fa fa-hand-spock-o fa-fw" aria-hidden="true"></i> Hand Icons</a></li>
|
|
<li><a href="../icons/#transportation"><i class="fa fa-ship fa-fw" aria-hidden="true"></i> Transportation Icons</a></li>
|
|
<li><a href="../icons/#gender"><i class="fa fa-venus fa-fw" aria-hidden="true"></i> Gender Icons</a></li>
|
|
<li><a href="../icons/#file-type"><i class="fa fa-file-image-o fa-fw" aria-hidden="true"></i> File Type Icons</a></li>
|
|
<li><a href="../icons/#spinner"><i class="fa fa-spinner fa-fw" aria-hidden="true"></i> Spinner Icons</a></li>
|
|
<li><a href="../icons/#form-control"><i class="fa fa-check-square fa-fw" aria-hidden="true"></i> Form Control Icons</a></li>
|
|
<li><a href="../icons/#payment"><i class="fa fa-credit-card fa-fw" aria-hidden="true"></i> Payment Icons</a></li>
|
|
<li><a href="../icons/#chart"><i class="fa fa-pie-chart fa-fw" aria-hidden="true"></i> Chart Icons</a></li>
|
|
<li><a href="../icons/#currency"><i class="fa fa-won fa-fw" aria-hidden="true"></i> Currency Icons</a></li>
|
|
<li><a href="../icons/#text-editor"><i class="fa fa-file-text-o fa-fw" aria-hidden="true"></i> Text Editor Icons</a></li>
|
|
<li><a href="../icons/#directional"><i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i> Directional Icons</a></li>
|
|
<li><a href="../icons/#video-player"><i class="fa fa-play-circle fa-fw" aria-hidden="true"></i> Video Player Icons</a></li>
|
|
<li><a href="../icons/#brand"><i class="fa fa-facebook-official fa-fw" aria-hidden="true"></i> Brand Icons</a></li>
|
|
<li><a href="../icons/#medical"><i class="fa fa-medkit fa-fw" aria-hidden="true"></i> Medical Icons</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="dropdown-split-left"><a href="../examples/">Examples</a></li>
|
|
<li class="dropdown dropdown-split-right hidden-xs">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
<i class="fa fa-caret-down" aria-hidden="true" title="Toggle dropdown menu"></i>
|
|
<span class="sr-only">Toggle dropdown menu</span>
|
|
<span class="toggle drop down"></span>
|
|
</a>
|
|
<ul class="dropdown-menu pull-right">
|
|
<li><a href="../examples/">Examples</a></li>
|
|
<li class="divider"></li>
|
|
<li><a href="../examples/#basic">Basic Icons</a></li>
|
|
<li><a href="../examples/#larger">Larger Icons</a></li>
|
|
<li><a href="../examples/#fixed-width">Fixed Width Icons</a></li>
|
|
<li><a href="../examples/#list">List Icons</a></li>
|
|
<li><a href="../examples/#bordered-pulled">Bordered & Pulled Icons</a></li>
|
|
<li><a href="../examples/#animated">Animated Icons</a></li>
|
|
<li><a href="../examples/#accessible">Accessibility-Minded</a></li>
|
|
<li><a href="../examples/#rotated-flipped">Rotated & Flipped Icons</a></li>
|
|
<li><a href="../examples/#stacked">Stacked Icons</a></li>
|
|
<li><a href="../examples/#bootstrap">Bootstrap 3 Examples</a></li>
|
|
<li><a href="../examples/#custom">Custom CSS</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="hidden-sm active"><a href="../accessibility/">Accessibility</a></li>
|
|
<li class="hidden-xs hidden-md hidden-lg active"><a href="../accessibility/"><i class="fa fa-universal-access"></i></a></li>
|
|
<li><a href="../community/">Community</a></li>
|
|
<li><a href="../license/">License</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="jumbotron jumbotron-ad hidden-print">
|
|
<div class="container">
|
|
|
|
<h1><i class="fa fa-universal-access" aria-hidden="true"></i> Accessibility</h1>
|
|
<p>Make your icons awesome for all of your users</p>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container">
|
|
<section id="accessibility-intro" class="accessibility-intro">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<p class="lead">
|
|
Icons are symbols that can convey a ton of information and really help
|
|
people comprehend directions, signs, and interfaces. It's important
|
|
that we create and use them so that they can reach the largest amount
|
|
of people possible.
|
|
</p>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div id="accessibility-background">
|
|
<h4 class="margin-top-none">About Icon Fonts & Accessibility</h4>
|
|
<p>
|
|
Modern versions of assistive technology, like screen readers, will read CSS generated content (how Fork Awesome icons are rendered), as well as specific Unicode characters. When reading our default markup for rendering icons, assisistive technology may have the following problems.
|
|
</p>
|
|
|
|
<ul>
|
|
<li>
|
|
The assistive technology may not find any content to read out to a user
|
|
</li>
|
|
<li>
|
|
The assistive technology may read the unicode equivalent, which could not match up to what the icon means in context, or worse is just plain confusing
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h2 class="page-header">
|
|
Using Fork Awesome with Acessibility in mind
|
|
</h2>
|
|
|
|
<section id="accessibility-manual" class="accessibility-manual">
|
|
|
|
<h3>
|
|
<i class="gg-col fa fa-wrench text-muted fa-lg padding-right" aria-hidden="true"></i>
|
|
Manually make your icons accessible
|
|
</h3>
|
|
|
|
<p>When using icons in your UI, there are manual techniques and ways to help assistive technology either ignore or better understand Fork Awesome.</p>
|
|
|
|
<h4 class="margin-top-xl">Icons used for pure decoration or visual styling</h4>
|
|
<p>If you're using an icon to add some extra decoration or branding, it does not need to be announced to users as they are navigating your site or app aurally. Additionally, if you're using an icon to visually re-emphasize or add styling to content already present in your HTML, it does not need to be repeated to an assistive technology-using user. You can make sure this is not read by adding the <code>aria-hidden="true"</code> to your Fork Awesome markup.</p>
|
|
|
|
<div class="margin-top-lg margin-bottom-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-fighter-jet"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span><span class="nt">></i></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used as pure decoration</small>
|
|
</div>
|
|
|
|
<div class="margin-bottom-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><h1</span> <span class="na">class=</span><span class="s">"logo"</span><span class="nt">></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-pied-piper"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span><span class="nt">></i></span>
|
|
Pied Piper, A Middle-Out Compression Solution Making Data Storage Problems Smaller
|
|
<span class="nt"></h1></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used as a logo</small>
|
|
</div>
|
|
|
|
<div class="margin-bottom-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><a</span> <span class="na">href=</span><span class="s">"https://github.com/FortAwesome/Font-Awesome"</span><span class="nt">><i</span> <span class="na">class=</span><span class="s">"fa fa-github"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span><span class="nt">></i></span> View this project's code on Github<span class="nt"></a></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used in front of link text</small>
|
|
</div>
|
|
|
|
<h4 class="margin-top-xl">Icons with semantic or interactive purpose</h4>
|
|
<p>
|
|
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. This goes for content you're abbreviating via icons as well as interactive controls (buttons, form elements, toggles, etc.). There are a few techniques to accomplish this:
|
|
</p>
|
|
|
|
<h4 class="margin-top-xl text-muted">If an icon is <strong>not</strong> an interactive element</h4>
|
|
<p>
|
|
The simplest way to provide a text alternative is to use the <code>aria-hidden="true"</code> attribute on the icon and to include the text with an additional element, such as a <code><span></code>, with appropriate CSS to visually hide the element while keeping it accessible to assistive technologies. In addition, you can add a <code>title</code> attribute on the icon to provide a tooltip for sighted mouse users.
|
|
</p>
|
|
|
|
<div class="margin-bottom-lg margin-top-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><dl></span>
|
|
<span class="nt"><dt></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-car"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"Time to destination by car"</span><span class="nt">></i></span>
|
|
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>Time to destination by car:<span class="nt"></span></span>
|
|
<span class="nt"></dt></span>
|
|
<span class="nt"><dd></span>4 minutes<span class="nt"></dd></span>
|
|
|
|
<span class="nt"><dt></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-bicycle"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"Time to destination by bike"</span><span class="nt">></i></span>
|
|
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>Time to destination by bike:<span class="nt"></span></span>
|
|
<span class="nt"></dt></span>
|
|
<span class="nt"><dd></span>12 minutes<span class="nt"></dd></span>
|
|
<span class="nt"></dl></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used to communicate travel methods</small>
|
|
</div>
|
|
|
|
<div class="margin-bottom-lg margin-top-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-hourglass"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"60 minutes remain in your exam"</span><span class="nt">></i></span>
|
|
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>60 minutes remain in your exam<span class="nt"></span></span>
|
|
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-hourglass-half"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"30 minutes remain in your exam"</span><span class="nt">></i></span>
|
|
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>30 minutes remain in your exam<span class="nt"></span></span>
|
|
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-hourglass-end"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"0 minutes remain in your exam"</span><span class="nt">></i></span>
|
|
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>0 minutes remain in your exam<span class="nt"></span></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used to denote time remaining</small>
|
|
</div>
|
|
|
|
<h4 class="margin-top-xl text-muted">If an icon represents an interactive element</h4>
|
|
<p>
|
|
In the case of focusable interactive elements, there are various options to include an alternative text or label to the element, without the need for any visually hidden <code><span></code> or similar. For instance, simply adding the <code>aria-label</code> attribute with a text description to the interactive element itself will be sufficient to provide an accessible alternative name for the element. If you need to provide a visual tooltip on mouseover/focus, we recommend additionally using the <code>title</code> attribute or a <a href="https://github.com/chinchang/hint.css">custom tooltip</a> solution.
|
|
</p>
|
|
|
|
<div class="margin-bottom-lg margin-top-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><a</span> <span class="na">href=</span><span class="s">"path/to/shopping/cart"</span> <span class="na">aria-label=</span><span class="s">"View 3 items in your shopping cart"</span><span class="nt">></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-shopping-cart"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span><span class="nt">></i></span>
|
|
<span class="nt"></a></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used to communicate shopping cart state</small>
|
|
</div>
|
|
|
|
<div class="margin-bottom-lg margin-top-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><a</span> <span class="na">href=</span><span class="s">"#navigation-main"</span> <span class="na">aria-label=</span><span class="s">"Skip to main navigation"</span><span class="nt">></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-bars"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span><span class="nt">></i></span>
|
|
<span class="nt"></a></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used as a link to a navigation menu</small>
|
|
</div>
|
|
|
|
<div class="margin-bottom-lg margin-top-lg">
|
|
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><a</span> <span class="na">class=</span><span class="s">"btn btn-danger"</span> <span class="na">href=</span><span class="s">"path/to/settings"</span> <span class="na">aria-label=</span><span class="s">"Delete"</span><span class="nt">></span>
|
|
<span class="nt"><i</span> <span class="na">class=</span><span class="s">"fa fa-trash-o"</span> <span class="na">aria-hidden=</span><span class="s">"true"</span> <span class="na">title=</span><span class="s">"Delete this item?"</span><span class="nt">></i></span>
|
|
<span class="nt"></a></span></code></pre></figure>
|
|
<small class="text-muted">an icon being used as a delete button's symbol with a <code>title</code> attribute to provide a native mouse tooltip</small>
|
|
</div>
|
|
|
|
|
|
<div class="alert alert-success">
|
|
<ul class="fa-ul margin-bottom-none">
|
|
<li>
|
|
<i class="fa-li fa fa-info-circle fa-lg" aria-hidden"true"></i>
|
|
<a href="../examples/#accessible">See more examples of how to add accessibility-minded icons</a> into your UI.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="accessibility-other" class="accessibility-other">
|
|
<h2 class="page-header">Other cases and information</h2>
|
|
<p>
|
|
While the scenarios and techniques here help avoid some serious issues and confusion, they are not exhaustive. There are many complex contexts and use cases when it comes to accessibility, such as users with low vision who need a high color contrast ratio to see UI. There are some great tools and resources to learn from and work on these issues out there. Here are a few reads we recommend.
|
|
</p>
|
|
|
|
<ul>
|
|
<li><a href="https://www.filamentgroup.com/lab/bulletproof_icon_fonts.html">https://www.filamentgroup.com/lab/bulletproof_icon_fonts.html</a></li>
|
|
<li><a href="https://css-tricks.com/html-for-icon-font-usage/">https://css-tricks.com/html-for-icon-font-usage/</a></li>
|
|
<li><a href="http://www.sitepoint.com/icon-fonts-vs-svg-debate/">http://www.sitepoint.com/icon-fonts-vs-svg-debate/</a></li>
|
|
<li><a href="http://leaverou.github.io/contrast-ratio">http://leaverou.github.io/contrast-ratio/</a></li>
|
|
</ul>
|
|
|
|
<p>
|
|
We'll continue to work on these under the larger topic of accessibility, but in the meantime, <a href="../community/#reporting-bugs">let us know if any bugs or issues</a>.
|
|
</p>
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<footer id="footer" class="footer hidden-print">
|
|
<div class="container text-center">
|
|
<div>
|
|
<i class="fa fa-fork" aria-hidden="true"></i> Fork Awesome 1.1.0
|
|
<span class="hide-xs">·</span><br class="hide-sm hide-md hide-lg">
|
|
A fork of Font Awesome, originally created by <a href="https://twitter.com/davegandy">Dave Gandy</a>
|
|
</div>
|
|
<div>
|
|
Fork Awesome is licensed under <a href="http://scripts.sil.org/OFL">SIL OFL 1.1</a>
|
|
<span class="hide-xs">·</span><br class="hide-sm hide-md hide-lg">
|
|
Code is licensed under <a href="http://opensource.org/licenses/mit-license.html">MIT License</a>
|
|
<span class="hide-xs hide-sm">·</span><br class="hide-md hide-lg">
|
|
Documentation is licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>
|
|
</div>
|
|
<div class="project">
|
|
<a href="https://github.com/ForkAwesome/Fork-Awesome">GitHub Project</a> ·
|
|
<a href="https://github.com/ForkAwesome/Fork-Awesome/issues">Issues</a>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
|
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
|
<script src="../assets/js/site.js"></script>
|
|
<script src="../assets/js/share.min.js"></script>
|
|
|
|
</body>
|
|
</html>
|