This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply idPrefix to references in aria-labelledby
To make svgs more accessible to people with screen readers, we can make use of a few elements and attributes: - <title> to set a title for the image - <description> to describe the image - @aria-labelledby to tell screen readers where the title and description are located in the tree Here's some more info on how to best use them: https://css-tricks.com/accessible-svgs/#article-header-id-6 We're using svg-inline-loader over at brigade.com to make sure every svg has unique ids, but after adding accessibility markup we noticed that the references weren't right: <svg viewBox="0 0 24 24" role="img" aria-labelledby="shareIconTitle shareIconDesc"><title id="__C3oQyi-__shareIconTitle">Share Icon</title><desc id="__C3oQyi-__shareIconDesc">Paper airline silhouette.</desc><path d="M21.184 2.073a.543.543 0 0 1 .806.574l-3.127 16.317a.657.657 0 0 1-.861.494l-4.866-1.825-2.075"></path></svg> (I've manually removed some stuff from the above svg to make it shorter). Notice how the references in aria-labelledby are now referencing missing ids. To fix this, we can apply the prefix here as well.
- Loading branch information