Skip to content
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

Accessibility features #225

Open
jackdomleo7 opened this issue Jan 17, 2021 · 3 comments
Open

Accessibility features #225

jackdomleo7 opened this issue Jan 17, 2021 · 3 comments

Comments

@jackdomleo7
Copy link

Hi, I have a few accessibility features/suggestions and wanted to hear your thoughts. If you'd like me to create separate issues for each one then I'm happy to do so (I kept them in one issue for now for tidiness).

  • All SVGs require some text alternative, so on <svg-icon/>, while the desc prop can remain optional, have you considered making the title prop a required prop? Keeping title as optional may mean accessibility will be skipped.
  • A prop for role on <svg-icon/> where the only valid values are application, document, and img (see here for details). Maybe this prop could be optional, with the default either being img or defined in nuxt.config.js?
  • Implement aria-describedby on the <svg> as demonstrated in this article and many other articles. The id for <title> and <desc> doesn't necessarily need to be props but could be dynamically generated from the title and desc props if they are provided (e.g. id="title.toLowercase().replace(/\s/g, '-')"). As long as the id's on the <title> and <desc> are generated inside the aria-describedby on the <svg>, then it should be all good. 👌
@farnabaz
Copy link
Collaborator

Hey, Sorry for the late response and Thank you for great explanation.
Will consider these improvements in next major release.

@farnabaz
Copy link
Collaborator

All SVGs require some text alternative, so on , while the desc prop can remain optional, have you considered making the title prop a required prop? Keeping title as optional may mean accessibility will be skipped

What about using file name as the fallback title? in this case using good names for svgs files will be enough and we don't force users to define title prop

@jackdomleo7
Copy link
Author

Sounds like a good idea! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants