Skip to content

fix(website): apply a CSP on GitHub Pages, make scrollers focusable, tidy the menu - #604

Merged
bmscomp merged 3 commits into
mainfrom
fix/website-p2
Nov 5, 2026
Merged

bmscomp merged 3 commits into
mainfrom
fix/website-p2

Conversation

@bmscomp

@bmscomp bmscomp commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Merge #603 first. This branch sits on top of it, so the diff here includes #603's commit until that lands.

Why

These are the audit's six P2s and one P3. The most consequential: no security header has ever reached a visitor, because GitHub Pages serves the site and ignores _headers.

What changed

  • CSP: the policy from _headers is also in a <meta> tag, with a referrer policy. The README says to change both together.
  • Keyboard scrolling: the code blocks and comparison table scroll sideways on phones, so they now take focus and have labels. The hero terminal loses role="img", which would have hidden a focusable child.
  • Mobile menu: Escape closes it and returns focus, its label resets after a link, and the toggle is 44×44.
  • Touch hints: hover and key hints are hidden on touch; the partition-leader legend stays.
  • Fonts: EB Garamond moves from a CSS @import to the main font link.
  • Screenshots: all four have width and height, so the page shouldn't jump as they load.
  • Cleanup: removes the unused website/assets/demo.gif (3.7 MB; the README uses its own copy in docs/assets) and the stale v1.0 in the hero terminal.

Scope changes

  • Removed the "1–5 phase" hint, because those keys were never wired up.
  • role="region" was dropped from the scroll areas because html-validate rejects it; the label and focus remain.
  • All nine font faces stay, because they are all in use.

Checks

  • html-validate@9, as CI runs it, passes, and every local asset resolves.
  • Browser at 375px with touch emulation: menu behavior, six focusable scroll areas, hints, and no sideways scroll. No console errors with the CSP active on localhost.
  • A real Tab press reaches the skip link.
  • impeccable detect: no contrast findings at either width. Remaining findings are the structure and typography items from the audit.

Not tested

The CSP on the live domain, emulated reduced motion, a full Tab walk, a screen reader, and a real phone.

Deliberately not done

frame-ancestors, nosniff and X-Frame-Options cannot be set from a <meta> tag, so they need a host that supports headers.

…igures pause

"Get started" rendered dark text on blue (2.0:1) because .nav-links a beat
.btn-primary. The Paper theme was patched on at the end of styles.css, so the
button's colors move to their own rule and the patch goes.

One --ok could not pass on both the light page and the dark code blocks, so
code gets its own tokens. The table's Yes and No, terminal titles, comments
and prompts and the skip link now meet 4.5:1.

On phones five timeline buttons needed 357px of 309px and the figure hid the
fifth. They wrap to 3 + 2. Both looping figures gain a pause button (WCAG
2.2.2), which stays hidden when motion is reduced because nothing loops then.
…tidy the menu

GitHub Pages serves the site and ignores _headers, so no Content-Security-Policy
ever reached a browser. The policy now sits in a meta tag too; frame-ancestors
cannot, and the other headers still need another host.

Code blocks and the comparison table scroll sideways on phones, so they take
focus and carry labels. The hero terminal loses role="img", which would have
hidden that focusable child. The menu closes on Escape, returns focus, resets
its label after a link and has a 44px toggle.

Touch screens no longer show hover and key hints, and the "1-5 phase" hint goes
because those keys never existed. EB Garamond joins the main font link instead
of an @import, the screenshots get dimensions, and demo.gif and the stale v1.0
go.
@bmscomp
bmscomp merged commit dbdf922 into main Nov 5, 2026
60 checks 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