Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd aria-labels to nav elements for accessibility #835
+12
−5
Conversation
|
|
|
/preview |
|
/preview |
github-actions
bot
commented
Aug 13, 2020
|
Please find a preview at: https://staging.nodejs.dev/835/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
jendowns commentedAug 12, 2020
Description
Both the Docs and Learn pages have two
<nav>landmarks. It would be helpful for assistive tech to distinguish between these two navigation areas.Since neither landmark appears to have a unique heading to point to (i.e., something like "Site navigation" versus "Learn"/"Documentation") I think going with
aria-labelattributes as described in WCAG 2.1aria-labelguidelines would work. So in this PR, I have addedaria-labelattributes to the<nav>landmarks, indicating that they are either the "Primary" nav (main site nav) or "Secondary" nav (inner page nav, like for "Learn" or "Docs" content specifically).Here's an example from the WCAG 2.1 docs following a similar method:
I'm totally open to switching up this label text -- just let me know!
Or if you prefer to follow the WCAG 2.1😅 ).
aria-labelledbyguidelines & point to some existing text/heading node on the page, that would also work -- just let me know where/what those headings are (I just very new to this repo & didn't see any existing nodes that fit the criteriaThank you!💖