Skip to content

Run key accessibility scans in dark mode too#1905

Merged
benbalter merged 2 commits into
mainfrom
widen-dark-mode-a11y-tests
Jul 11, 2026
Merged

Run key accessibility scans in dark mode too#1905
benbalter merged 2 commits into
mainfrom
widen-dark-mode-a11y-tests

Conversation

@benbalter

Copy link
Copy Markdown
Owner

Why

Dark mode was only spot-checked on the homepage and one blog post. The Axe multi-page scan (About/Resume/Contact/Talks), the color-contrast check, and the mobile/tablet viewport scans all ran in light mode only. color-contrast is the axe rule most sensitive to theme, so a dark-mode-only regression on a secondary page or at a given viewport would have gone uncaught.

What

Parameterize those scans over COLOR_SCHEMES = ['light', 'dark'] via page.emulateMedia({ colorScheme }):

Scan Before After
Color contrast (homepage) light only light + dark
Axe multi-page (About/Resume/Contact/Talks) light only light + dark
Mobile + tablet viewport light only light + dark
Homepage + blog post (existing Dark Mode block) already both unchanged

40 → 49 tests. emulateMedia only overrides colorScheme, so the reducedMotion: 'reduce' set in beforeEach persists — which matters, since that's what prevents axe's fade-in animation false-positives on cards.

The 404 page is left light-only on purpose (low value; its layout mirrors pages already covered in both themes).

Verification

All 49 tests pass locally against the built astro preview, including every new dark-mode variant — confirming the site is genuinely clean in dark mode rather than the assertions being vacuous.

🤖 Generated with Claude Code

benbalter and others added 2 commits July 10, 2026 19:50
Dark mode was only spot-checked on the homepage and one blog post, so the Axe
multi-page scan, the color-contrast check, and the mobile/tablet viewport scans
all ran in light mode only. Contrast is the axe rule most sensitive to theme, so
a dark-mode-only regression on the About/Resume/Contact/Talks pages or at a given
viewport would have gone uncaught.

Parameterize those scans over a COLOR_SCHEMES = ['light', 'dark'] list via
page.emulateMedia({ colorScheme }). emulateMedia only overrides colorScheme, so
the reducedMotion preference set in beforeEach persists. All variants pass locally
against the built preview, confirming the site is clean in dark mode rather than
the tests being vacuous.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@benbalter
benbalter merged commit d6b5f39 into main Jul 11, 2026
12 checks passed
@benbalter
benbalter deleted the widen-dark-mode-a11y-tests branch July 11, 2026 00:11
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