· 2 min read · updated
A contrast bug the audit missed
Found that --text-2 (gray-6) was only about 3:1 on light surfaces, below the 4.5:1 minimum for text. Changed it to gray-7 (7.3:1 or better) and --text-1 to…
What we did
- Found that
--text-2(gray-6) was only about 3:1 on light surfaces, below the 4.5:1 minimum for text. Changed it togray-7(7.3:1 or better) and--text-1togray-9, so the two stay distinct. - Ran Lighthouse from the command line against the preview build, in both themes: 100 on the home page and the CV page.
What I learned
- Lighthouse passed in Phase 3 because no page used
--text-2yet. An audit only checks colors a page actually uses. Check a token pair's contrast when you define it. - Lighthouse CLI from WSL, using Playwright's Chromium:
CHROME_PATH=~/.cache/ms-playwright/chromium-1228/chrome-linux64/chrome pnpm dlx lighthouse@12 <url> --only-categories=accessibility --chrome-flags="--headless=new --no-sandbox" - For dark mode, add
--force-dark-modeto the Chrome flags.--force-prefers-color-scheme=darkdoesn't exist, and Chrome silently ignores it. I only noticed by checkingmatchMediain headless Chrome. - Lesson: when a flag "works", check that it actually did something.
Problems & fixes
- My first "dark" Lighthouse run was really light. See above.
- The Devlog page scores 98 (
heading-order:h1jumps toh3). It was already like that, and the page gets rebuilt in Phase 6.
Links
Next
- Fix the Devlog heading order in Phase 6.