Accessibility
What I built in for keyboard, screen-reader, low-vision and reduced-motion visitors, how I check it, and what I have not covered yet. I hold the site to the commitment in my product brief: semantic structure, keyboard and focus support, and prefers-reduced-motion respected.
Structure
- Pages have a single
h1and amainlandmark, supplied by theContainer. I know the heading order is not clean everywhere: see the About page under “What I have not covered”. - The document language is set (
<html lang="en">). - Visually hidden text goes through one
VisuallyHiddencomponent instead of ad hoc CSS.
Keyboard and focus
- One focus ring helper.
focusRing()insrc/config/styles/helpers/focusRing/defines the:focus-visibletreatment for almost everything: a 2px ring in the ink color, with four named offsets (inset,tight,standard,wide) so it never clips or crowds. The theme toggle uses theaccenttone because it sits on the accent color. Two places define their own outline:Button.css.ts, whose ring color depends on the button tone, andsrc/app/global-error.tsx, a standalone error boundary that cannot use the theme. - Native dialog. The resume dialog is a real
<dialog>opened withshowModal(). The browser makes the page behind inert, Escape closes it, and focus returns to the trigger without scrolling the page. The scroll lock covers wheel, touch and keyboard. - Scrolling stays interruptible. Smooth scrolling yields to wheel, touch and navigation keys, and landing anchors align the same way whether you arrive by link or by scroll. See Anchor navigation.
Announcements
- The skill search announces its result count through a polite live region, and its empty state has
role="status". - The theme toggle has an accessible name and announces the change.
- A slow first load is announced as “Loading” through a status region in the root layout, but only if hydration takes longer than 800 ms, so a fast load announces nothing. The visual chip is
aria-hidden. - Copy that screen readers read, such as the hero’s accessible title, is in the locale file with the rest of the copy.
Reduced motion
With prefers-reduced-motion: reduce, content is shown immediately in its final state. Entrance animations are off in CSS, the route fade does not run, the hero’s scroll-driven motion is off, hash links jump instead of gliding, and the dialog has no fade or rise. Framer-motion pieces run with a duration of 0, and MotionConfig reducedMotion="user" is set once in ClientLayout. The rule that every duration comes from src/config/motion.ts is what makes this one switch instead of many. The full list is in Motion and transitions, and a probe checks that titles are opaque on the first frame.
Color and contrast
- Every color is an
oklch()value from a token, so contrast can be reasoned about in one place. See Color convention. - I test contrast. The tests hold the WCAG AA ratio of 4.5:1 for button labels on their fill, under the sheen, spotlight and grain (
ButtonContrast.test.ts), and for text on glass surfaces, including when text is softened by the landing focus effect (glassContrast.test.ts). - Email templates keep every color pair above 4.5:1, so clients that invert colors stay readable. See Email templates.
How it is checked
| Check | Where | Blocks CI |
|---|---|---|
| Contrast ratios for buttons and glass | Unit tests, pnpm test | Yes |
| axe on every Storybook story, prototypes excluded | @storybook/addon-a11y, pnpm test | Yes |
| axe on every built portfolio route | pnpm probe:a11y | No, run locally |
| axe and ARIA checks on docs search | Browser tests, pnpm --dir docs-site test:search | Yes (docs job) |
| Reduced-motion behavior | pnpm probe:transitions | No, run locally |
| Screen-reader pass | Manual, checklist below | No |
axe on built pages
pnpm probe:a11y (scripts/probes/a11y.mjs) drives Chromium with @axe-core/playwright against a running production server. It finds the routes from the landing page’s links plus /about and /resume, then visits each one in the light and the dark theme and fails on any serious or critical violation. It is not part of CI, so run it locally after a UI change: pnpm build && pnpm start, then pnpm probe:a11y in another terminal. PROBE_ROUTES=/,/about limits the routes.
The run uses prefers-reduced-motion: reduce so entrance animations are in their final state. Without it, axe reads text halfway through a fade and reports contrast failures that no visitor sees. The rule set is WCAG 2.0 to 2.2 A and AA plus axe best practices, and no rule is disabled.
Storybook checks
.storybook/preview.ts sets the addon to test: "error", so an axe violation in any story fails pnpm test. Four landing stories turn off only the color-contrast rule, each with a comment: they capture a frame from an entrance fade or the hover dim, where text is faint on purpose. The built-page run above checks contrast on settled pages.
Screen-reader pass
A manual pass on the built site, before a release that changes structure, navigation or copy. Test with VoiceOver on Safari (macOS) and NVDA on Firefox or Chrome (Windows). Do each step on the landing page, /about, /resume, one /skills/* page and one /experience/* page.
- The page announces one
h1, and heading navigation reaches every section without a surprise level. - Landmarks list the header navigation,
mainand the footer. The adjacent-role links on an experience page start with “Earlier role” or “Later role”, then the title, company and dates. - The skill search announces its result count as you type, and the empty state is read.
- The theme toggle reads its name and announces the new theme.
- The resume dialog opens with focus inside it, the page behind is unreachable, and Escape returns focus to the trigger.
- The experience tabs on the landing page read as a tab list, and arrow keys move between them.
- Links and buttons are named by what they do. A chip on a skill page reads the skill, its count and “named together in resume lines”.
- With reduced motion on, no content arrives late or stays hidden.
Results
| Date | Screen reader and browser | Result |
|---|---|---|
| VoiceOver, Safari | Not run yet | |
| NVDA, Firefox or Chrome | Not run yet |
Add a row per pass with the date, the versions, and what failed or needed a fix.
What I have not covered
- Heading order on
/about.AboutLetter.tsxrenders the greeting as anh3straight after the pageh1, so heading navigation skips a level. The firsth2comes later, in the next section. - No skip link. I have not added a skip-to-content link.
- No recorded screen-reader pass. I wrote the checklist above and have not run it, so the results table is empty.
- axe does not cover everything. It finds around a third of WCAG failures, so I do not treat a green axe run as proof that a page is accessible. Reading order, focus order and the quality of names need the manual pass.