fix(a11y): Move focus explicitly to main on skip link activation#93
Merged
Conversation
Dossier appendix (French): Lighthouse 13.4.0 and axe-core 4.12.1 run against every page of the running application at dev commit 8c82a93, including the authenticated dashboard (real session) and the register error state. Every page scores 100/100 on Lighthouse and zero axe violations under the WCAG 2.1 A/AA rule set. The manual keyboard walkthrough records the full tab order with a visible 2 px focus ring on all 12 stops, proves the skip link works (the Tab after activating it lands in the form), and completes a keyboard-only login. axe's color-contrast incomplete items are resolved manually against the computed token ratios (worst shipped pair 4.73:1). One robustness recommendation: add tabindex=-1 on main#main so the skip link moves focus explicitly. The reproduction commands are in the report; docs/rgaa.md now links to it and its remaining-passes list shrinks to the VoiceOver smoke test.
Both glossaries gain the two audit tools referenced by the new RGAA self-audit report, in the build and tooling section, EN and FR kept in sync per the glossary rule.
Add tabindex="-1" to the main landmark of all 7 page templates so activating the "Skip to main content" link moves focus onto main explicitly, instead of relying on the browser's sequential focus navigation starting point (more robust with older assistive technologies). Suppress the focus ring on main with a main:focus rule in base.css: keyboard activation of the skip link makes main match the global :focus-visible rule, which drew a 2px outline around the whole content region (verified in a browser). The landmark is not interactive, so WCAG 2.4.7 does not apply to it. Mark the corresponding recommendation in docs/rgaa-audit.md as implemented.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #93 +/- ##
=========================================
Coverage 81.30% 81.30%
Complexity 62 62
=========================================
Files 23 23
Lines 246 246
Branches 13 13
=========================================
Hits 200 200
Misses 32 32
Partials 14 14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves accessibility for screen-reader users using
Skip to main content.It ensures that:
Skip to main contentalways jumps to the main landmark (the<main>tag in our case)How?
tabindex="-1"to the main landmark of all the page templates so that activating the "Skip to main content" link moves focus ontomainexplicitly, instead of relying on the browser's sequential focus navigation starting point (more robust with older assistive technologies).main:focusrule inbase.css:mainmatch theglobal:focus-visiblerule.2pxoutline around the whole content region (verified in a browser).Update
docs/rgaa-audit.mdto mark the corresponding recommendation as implemented.