{"id":20929,"date":"2023-02-21T13:05:00","date_gmt":"2023-02-21T19:05:00","guid":{"rendered":"https:\/\/theadminbar.com\/?post_type=accessibility-weekly&p=20929"},"modified":"2024-02-10T06:59:54","modified_gmt":"2024-02-10T12:59:54","slug":"font-awesome-and-icon-fonts-accessibility","status":"publish","type":"accessibility-weekly","link":"https:\/\/theadminbar.com\/accessibility-weekly\/font-awesome-and-icon-fonts-accessibility\/","title":{"rendered":"Font Awesome and Icon Fonts Accessibility"},"content":{"rendered":"\n
Imagine this scenario: you found an excellent resource for your next article. You want to thank the author and tag them when you share it, so you look for their Twitter account. You find the Twitter logo at the bottom right corner of their website. You click on it and are immediately redirected to their Twitter. Easy enough.<\/p>\n\n\n\n
But what if you were using a screen reader? Would you still get the same experience? Probably not.<\/p>\n\n\n\n
Linked icons, often created with icon fonts such as Font Awesome, are commonly used in user interfaces for websites and mobile applications. Icons are used to represent various functionalities, such as navigation controls, social media links, search bars, and menu items. Icon fonts can also used for indicating status or providing visual feedback to users, such as warning signs or confirmation symbols.<\/p>\n\n\n\n
Because icons have the potential to communicate a wide range of important information, it’s crucial that they are accessible to as many people as possible and can be understood when using a screen reader or other assistive technology.<\/p>\n\n\n\n
Icons are utilized in two ways across websites, apps, and other digital interfaces, and how they are handled from an accessibility standpoint depends on how that icon is used – whether it\u2019s decorative or functional in a link or button.<\/p>\n\n\n\n
If you’re utilizing an icon for decorative or branding purposes, there’s no need to notify screen reader users that the icon is there. Here are examples of how an icon might be used that is considered decorative:<\/p>\n\n\n\n
If the icon is used to highlight or style content already present in your HTML visually, it doesn’t need to be reiterated for users relying on assistive technology.<\/p>\n\n\n\n
When an icon is added to the website purely for decorative purposes, it should be concealed from screen readers so that they will skip the icon and not read it out. No needs to hear \u201cRead more about us. Graphic. Right pointing arrow,\u201d for example. It\u2019s unnecessary clutter that distracts from the point of the content.<\/p>\n\n\n\n
If you have decorative icons on your site, the best way to make them accessible is to hide them from screen readers completely with aria-hidden=\u201dtrue\u201d<\/a>. Here is an example:<\/p>\n\n\n\n If you’re using an icon on a button or link, it\u2019s crucial to ensure the purpose of that button or link is communicated to users through text-based alternatives. This applies to abbreviated content (such as shopping cart status or a number of unread messages) and interactive controls (such as buttons, form elements, and toggles).<\/p>\n\n\n\n In our website audits, failure to provide an accessible label is one of the most common problems that we find, especially when an icon font is being used. Going back to the example we opened this article with, here\u2019s an example of an inaccessible<\/em> (I.e., bad) linked icon:<\/p>\n\n\n\n A sighted person would see this as a link to Twitter but if a screen reader encountered this it would just read out \u201cLink\u201d with no additional information. In Equalize Digital Accessibility Checker, you would see this flagged as an Empty Link Error.<\/p>\n\n\n\n There are two ways to fix this.<\/p>\n\n\n\n You can add hidden screen reader text<\/a> before or after the link to add context for screen readers only.<\/p>\n\n\n\n You can add an aria-label to the link to add context for screen readers only.<\/p>\n\n\n\n Here are some additional resources for reading more about accessibility in icon fonts.<\/p>\n\n\n\n<a href=\"\/about\">Read more about us <i aria-hidden=\"true\" class=\"fas fa-arrow-right\"><\/i><\/a>\n<\/code><\/pre>\n\n\n\n
Icons on Buttons or Links<\/strong><\/h2>\n\n\n\n
<a href=\"<https:\/\/twitter.com\/heyamberhinds>\"><i class=\"fab fa-twitter\"><\/i><\/a>\n<\/code><\/pre>\n\n\n\n
Add Screen Reader Text to Icon Fonts<\/h3>\n\n\n\n
<a href=\"<https:\/\/twitter.com\/heyamberhinds>\"><i class=\"fab fa-twitter\"><\/i><span class=\u201dscreen-reader-only\u201d>Amber\u2019s Twitter Profile<\/span><\/a>\n<\/code><\/pre>\n\n\n\n
Use an ARIA Label<\/h3>\n\n\n\n
<a href=\"[<https:\/\/twitter.com\/heyamberhinds>](<https:\/\/twitter.com\/heyamberhinds>)\" aria-label=\u201dAmber\u2019s Twitter Profile\u201d><i class=\"fab fa-twitter\"><\/i><\/a>\n<\/code><\/pre>\n\n\n\n
Additional Resources for Accessible Icon Fonts<\/strong><\/h2>\n\n\n\n
\n