Repository navigation
a11y(install): make scrollable code blocks keyboard-focusable - #14
Merged
Merged
Conversation
Give every .install-code-pre in CopyCodeBlock tabindex="0", role="region", and a package-specific aria-label so overflowed install commands can be reached and arrow-scrolled from the keyboard. Add an inset :focus-visible outline in --orange-text (5.49:1 on white).
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.
Follow-up to the website#13 live recheck. Contrast and link-in-text-block stayed at 0, but
/install/at 390px had a seriousscrollable-region-focusablefailure on four.install-code-preblocks (dpkg install, checksums verify,docker pull, docker run). They overflow horizontally and were not keyboard-focusable (tabIndexwas-1). The issue is absent at 1280px, where the same blocks do not overflow.Fix
In
CopyCodeBlock(the one component that renders every install code sample):tabIndex={0}so the<pre>can take keyboard focusrole="region"aria-labelnames each block, e.g.Debian / Ubuntu install command,Debian / Ubuntu checksum verification command,Docker pull command,Docker run command:focus-visibleoutline is2px solid var(--orange-text)withoutline-offset: -2px(inset so it is not clipped by.install-code-block { overflow: hidden }).#a35400on the#fffpre background is 5.49:1, above the 3:1 non-text minimum. Layout, typography, and copy are otherwise unchanged.--bitcoin-orangefills/borders are untouched.Axe before / after
Local static export of parent
1282a1a(CSSe84e02787e85f98c.css) vs this head (CSS030b8589a03dbd73.css). Playwright + axe-core, rulescolor-contrast,link-in-text-block, andscrollable-region-focusable./install//install//(spot-check)/(spot-check)Keyboard check at 390: Tab reaches all four blocks (
:focus-visibletrue). With that focus, ArrowRight scrolls the first overflowing pre (scrollLeft0 → 9 → 33 → 65). Same Tab reach at 1280 (those blocks do not overflow).npm test(5/5) andscripts/check-public-claims.py(phrases) passed. Fetch-release logic anddata/install-content.jsonwere not changed.Live recheck plan (@tester)
After the Pages deploy for this merge:
/install/at 390px, axescrollable-region-focusableshould be 0. The four.install-code-preblocks should still overflow, but now be focusable.tabindex="0",role="region", and a uniquearia-label(package + command).#a35400) inset outline; ArrowRight / ArrowLeft should scroll the overflowed command./install/(expect 0) and a spot-check of/at both widths so contrast / link-in-text-block stay at 0.030b8589a03dbd73.css).@review, can you check it? I’ll merge once it’s green and you’re OK with it.