-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature: add skip to content links #96
Conversation
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.
@KeshavChawla This is great to have! Thanks for your work!
left: 0; | ||
height: fit-content; | ||
pointer-events: none; | ||
opacity: 0.0001; |
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.
can opacity
just be 0?
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.
Hey @DonghyukJacobJang!
Normally I would say yes, but ChromeVox has a bug where it skips reading out content with opacity 0 when a user is navigating with their keyboard. The hacky fix for this was to just set the element with opacity: 0.0001;
. While not ideal, I think it guarantees the maximum number of screen readers will be able to read the link while not impacting design. That being said, if we don't need to support ChromeVox then I can set it to opacity 0.
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.
@DonghyukJacobJang Keshav was correct on this. For AAA sites any use of opacity animation has to use 0.0001 for it's starting opacity. So this is good to have. Let's approve and merge this if everything is groovy. ✌️
Merging this @DonghyukJacobJang we tested this in Tonal and worked fine |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Adviser warns of an error with netmask (high).
Advisory code is 1658: https://www.npmjs.com/advisories/1658**
Did you test your solution?
Problem Description
Per WCAG 2.1 AA compliance having bypass blocks on each page is necessary.
Solution Description
One notably method of solving this is by:
An alternate solution for Jam3 projects would include adding a subnav which satisfies the criteria:
This PR creates a tab-able, screen readable skip to content button which the user can click to skip the navbar on each page. It does so by using an anchor link at the bottom of the nav page to change focus.
Notable findings:
opacity: 0;
ChromeVox seems to ignore elements with opacity 0 all together when a user is navigating with their keyboard. A fix for this is to set the element withopacity: 0.0001
. While this is not ideal, it guarantees the maximum number of screen readers will be able to read the link while not impacting design. In the future, when this ChromeVox bug is patched, opacity should be adjusted back to 0.Unfocused link:
Focused Link:
Test with ChromeVox (audio) showing that selecting the Skip to Content skips the Nav and goes directly to focus on the "Welcome to Jam3."
Skip.To.Content.ChromeVox.mp4
Side Effects, Risks, Impact
Let me know if I should add the advisor warning to
adviserrc.json
.Additional comments: