Skip to content

Pause the landing page's animation before checking contrast - #509

Merged
lauPhilip merged 4 commits into
masterfrom
fix/a11y-animation-flake
Nov 25, 2026
Merged

lauPhilip merged 4 commits into
masterfrom
fix/a11y-animation-flake

Conversation

@lauPhilip

Copy link
Copy Markdown
Owner

The accessibility job in CI has been failing at random on the landing page, with a colour-contrast error on the green "Supported" text of the citation example. The example is a CSS animation that fades each verdict in and out, and axe reads colours as they are drawn, so when it looked during a fade the half-transparent text failed. A re-run passed, and at least five pull requests were hit. Checking the landing page 48 times in a row locally reproduced it 11 times.

This pull request fixes it in the check, not by weakening the rule. tools/a11y/axe-check.mjs now opens every page asking for less motion (prefers-reduced-motion: reduce), which CitationLoop already honours by stopping on its first verdict, fully drawn. Before axe runs, any animation or transition that still runs to an end is run to it, and any endless one still running is paused, so axe and the screenshots see the same settled frame. Every page and every rule is still checked. With the change, the same 48 landing checks passed three times in a row (144 of 144), and the full CI page list, light and dark, passed three times locally.

Because axe now sees the example only on its first verdict, a new test, CitationLoopContrastTests, checks every state of the example at its final colours in both themes, straight from the tokens in Styles/tailwind.input.css: a citation being checked, each of the three verdict highlights, the chips, and the text and notes on each verdict card. All reach 4.5:1. A second test pins the loop's keyframes to the tokens it checks, so a change there cannot slip past.

Nothing changes for the systematic review or for the site itself; only the check and its tests change. The wiki pages 06 and 07 describe the new behaviour.

Closes #503


Generated by Claude Code

claude and others added 3 commits November 25, 2026 15:22
…es it

The check now opens pages asking for less motion and finishes or pauses any
animation before axe runs, so a fade caught half-way no longer fails colour
contrast at random on the landing page (#503).

Co-Authored-By: Philip Lau <philip15@live.dk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdMWuRPVdnazxun96Pb78e
The CI check sees the citation example only on its first verdict, so the
checking, partly and not supported states are checked here at their final
colours, in both themes (#503).

Co-Authored-By: Philip Lau <philip15@live.dk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdMWuRPVdnazxun96Pb78e
Co-Authored-By: Philip Lau <philip15@live.dk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdMWuRPVdnazxun96Pb78e
@lauPhilip lauPhilip self-assigned this Nov 25, 2026
Co-Authored-By: Philip Lau <philip15@live.dk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdMWuRPVdnazxun96Pb78e
@lauPhilip
lauPhilip merged commit e1e0b44 into master Nov 25, 2026
11 checks passed
@lauPhilip
lauPhilip deleted the fix/a11y-animation-flake branch November 25, 2026 15:00
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.

The accessibility check fails at random on the landing page's moving example

2 participants