-
-
Notifications
You must be signed in to change notification settings - Fork 186
fix: improve labelling of landmarks #311
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: improve labelling of landmarks #311
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
danielroe
left a comment
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.
❤️
- There should only be one of each of these per document. - Any `<header>` or `<footer>` element that’s scoped to the `<main>` element or sectioning content element will not have the corresponding landmark role, so you don’t need to stop using them because they do not cause conflicts with the ones with the implicit landmark roles. - Thus, the labels are completely unnecessary and not expected.
AT will already present the ARIA `role` “navigation” so including it in the label is redundant.
Head branch was pushed to by a user without write access
51dbdb5 to
94d40cd
Compare
|
@danielroe Oops, I didn’t realize syncing with the base branch would cancel that automerge. |
|
no worries - just fyi, the merge queue will sync automatically and make sure tests pass when branch is up-to-date, so no need to sync unless there are conflicts |
I did a very quick pass of the markup structure and made a few changes that immediately stood out:
Removes unnecssary
aria-labelforbanner/contentinfolandmarksRemoved the label from the body-scoped
<header>element. When scoped to the body and not the<main>element or other sectioning content (e.g.<article>,<header>,<footer>,<nav>,<aside>,<section>), a<header>element will implicitly have the role ofbannerwhich is a landmark role. According to the ARIA spec for thebannerrole:Accessible names are typically used to disambiguate elements with the same role and since there is only one element with this role, then the label is unnecessary.
The same applies to the body-scoped
<footer>element which has thecontentinfolandmark role.I should add that it is totally fine to use
<header>and<footer>elements within the<main>element like you are.Removes redundant “navigation” label from navigation landmarks
When assistive technology presents an element with the
navigationlandmark role (e.g.<nav>elements) it includes the role in the presentation. For example, a screen reader will read “navigation” or, for a labelled landmark, “Main navigation.” So, adding “navigation” to the label is redundant, since a screen reader would read “Main navigation navigation” (and include it that way in its rotor/landmark list).