-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icons: Are they always decorative? #1965
Labels
Comments
If we do add an attribute to the SVGs, we should be able to add it via svgo by editing the config at https://github.com/cfpb/design-system/blob/main/svgo.config.js and adding something like https://svgo.dev/docs/plugins/add-attributes-to-svg-elements/ |
contolini
added a commit
to cfpb/consumerfinance.gov
that referenced
this issue
Apr 26, 2024
To play nicer with assistive technologies, we sometimes need to add ARIA attributes to our SVG icons, e.g. `aria-hidden=true`. See cfpb/design-system#1965
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are our SVG icons always decorative? If so, we should add
aria-hidden="true"
to the SVGs' source code. So far, I haven't been able to find an SVG icon on cf.gov that isn't also coupled with a link, heading, etc.The other option would be to add a
hidden
parameter to our svg loading function so that imported SVGs can optionally havearia-hidden="true"
when desired.See https://css-tricks.com/accessible-svg-icons/
The text was updated successfully, but these errors were encountered: