Skip to content

a11y(install): make scrollable code blocks keyboard-focusable - #14

Merged
secsovereign merged 1 commit into
mainfrom
ux/install-code-focusable
Nov 19, 2026
Merged

secsovereign merged 1 commit into
mainfrom
ux/install-code-focusable

Conversation

@secsovereign

Copy link
Copy Markdown
Member

Follow-up to the website#13 live recheck. Contrast and link-in-text-block stayed at 0, but /install/ at 390px had a serious scrollable-region-focusable failure on four .install-code-pre blocks (dpkg install, checksums verify, docker pull, docker run). They overflow horizontally and were not keyboard-focusable (tabIndex was -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 focus
  • role="region"
  • aria-label names each block, e.g. Debian / Ubuntu install command, Debian / Ubuntu checksum verification command, Docker pull command, Docker run command

:focus-visible outline is 2px solid var(--orange-text) with outline-offset: -2px (inset so it is not clipped by .install-code-block { overflow: hidden }). #a35400 on the #fff pre background is 5.49:1, above the 3:1 non-text minimum. Layout, typography, and copy are otherwise unchanged. --bitcoin-orange fills/borders are untouched.

Axe before / after

Local static export of parent 1282a1a (CSS e84e02787e85f98c.css) vs this head (CSS 030b8589a03dbd73.css). Playwright + axe-core, rules color-contrast, link-in-text-block, and scrollable-region-focusable.

Page width color-contrast before → after link-in-text-block scrollable-region-focusable before → after
/install/ 390 0 → 0 0 → 0 4 → 0
/install/ 1280 0 → 0 0 → 0 0 → 0
/ (spot-check) 390 0 → 0 0 → 0 0 → 0
/ (spot-check) 1280 0 → 0 0 → 0 0 → 0

Keyboard check at 390: Tab reaches all four blocks (:focus-visible true). With that focus, ArrowRight scrolls the first overflowing pre (scrollLeft 0 → 9 → 33 → 65). Same Tab reach at 1280 (those blocks do not overflow).

npm test (5/5) and scripts/check-public-claims.py (phrases) passed. Fetch-release logic and data/install-content.json were not changed.

Live recheck plan (@tester)

After the Pages deploy for this merge:

  • On /install/ at 390px, axe scrollable-region-focusable should be 0. The four .install-code-pre blocks should still overflow, but now be focusable.
  • Confirm each has tabindex="0", role="region", and a unique aria-label (package + command).
  • Tab to each block and confirm a visible dark-orange (#a35400) inset outline; ArrowRight / ArrowLeft should scroll the overflowed command.
  • Repeat axe at 1280px on /install/ (expect 0) and a spot-check of / at both widths so contrast / link-in-text-block stay at 0.
  • Confirm the new CSS hash is live (this build used 030b8589a03dbd73.css).

@review, can you check it? I’ll merge once it’s green and you’re OK with it.

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).
@secsovereign
secsovereign merged commit 25e9526 into main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant