-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix(theme): improve docs sidebar category caret aria-label accessibility #9269
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx
Outdated
Show resolved
Hide resolved
@msftedad can you please review this PR and tell us if it improves accessibility for you? Preview url: https://deploy-preview-9269--docusaurus-2.netlify.app/ Thanks |
Hi @slorber its not "fix(a11y): fix docs sidebar category caret button accessibility, improve aria-label" as its not only for docs, it will affect the sidebar on every page using docusaurus. Its a change on the main product. The sidebar of the generated sites will have this a11y. Its better for users with screen readers to know if the sidebar category button is expand/collapse type so that they know the action they are performing. Ignore if you mean the documentation site(site generated by docusaurus) as docs. |
Sorry but I don't understand 😅 |
Hi @slorber, people who are visually impaired rely on screen readers, the screen readers read the content of the website to them. But some complex components like button with a icon, its really hard for them(screen readers) to know the function of the button, and they don't know what to say aloud. So aria-label is used to so that they know what the button does and they say that aloud. So, in sidebar, in dropdown now the screen reader will say if the dropdown is collapsed or expanded, so the visually impaired person can know if clicking it will collapse the menu or expand it. As docusaurus generates website, which has sidebar, so the now the newly created websites with docusaurus will have better a11y for such persons in the sidebar. As previously it was reading "Toggle the collapsible sidebar category 'Getting Started'", so it was unclear now it will be reading "Expand/Collapse the collapsible sidebar category 'Getting Started" based on the button state. Hope you understand it now. 😉 |
Hi @slorber, as mentioned in #9162 (comment) by @msftedad, you can now merge this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Just renamed the "isActive" props to "collapsed" because it's not super clear what isActive means if we extract later the button to a separate file
Pre-flight checklist
Motivation
Fixes #9162
Test Plan
Test links
https://deploy-preview-9269--docusaurus-2.netlify.app/
Related issues/PRs
#9162