Repository navigation
fix: homepage - Raise 'Most chosen' badge text contrast to WCAG AA - #102
Conversation
Bug fix - "Most chosen" badge on the featured Growth card failed WCAG AA (4.16:1, needs 4.5:1) - Badge text now uses the text.brand-strong token instead of text.brand - Applied to both the block comment and the rendered <p> inline colour Context - Found by axe in the mobile-menu Playwright spec on DEV (Mobile Chrome, Mobile Safari, Tablet) - Existing issue in the pattern, not caused by the mobile menu PRs (#96, #97) - Badge background tint is unchanged (still derived from text.brand) Verification - text.brand-strong resolves to brand-800 (light) and cta-200 (dark) - Calculated contrast: about 7.66:1 light, 10.6:1 dark - mobile-menu spec on localhost:8882: 0 failures in light and dark, all three device projects
Changelog - Document the "Most chosen" badge contrast fix under Unreleased Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe Growth card’s “Most chosen” badge now uses the stronger brand text color. Its background and other styling remain unchanged. The changelog records the change and reported contrast ratios. ChangesHomepage badge styling
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The badge text uses the stronger color without changing its background tint, with available contrast calculations above the AA target in both modes. No actionable merge-blocking risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
@coderabbitai review |
|
Describe the bug
The "Most chosen" badge on the featured Growth card in the homepage "Foundation, Growth or Enterprise" section fails WCAG 2.2 AA colour contrast. Its text uses
text.brand(#1C5EE4, bold, 11.4px) on a 14% brand tint (#D6DFF2), which gives 4.16:1 against the required 4.5:1.This is an existing issue in
patterns/sections/homepage-where-to-fit.php. It surfaced when the mobile-menu Playwright spec was run on the DEV site, because that spec scans the whole homepage behind the open menu.Change
text.brand-strongtoken instead oftext.brand, in both the block comment attributes and the rendered<p>inline colour.text.brand).text.brand-stronghas distinct values per mode:brand-800(#123B8F) in light andcta-200(#B8F5FF) in dark. Calculated contrast on the tint is about 7.66:1 (light) and 10.6:1 (dark).To Reproduce
npx playwright test mobile-menu --project="Mobile Chrome"against the DEV site (BASE_URL=https://ls-agency.lightspeedwp.dev).has no other serious/critical axe violationstest fail with onecolor-contrastviolation on.ls-package-card__badge. It fails on Mobile Chrome, Mobile Safari and Tablet.Expected behaviour
The badge text meets 4.5:1 in light and dark mode, and the axe test passes.
Screenshots
No visual capture was taken. The visible change is darker navy badge text in light mode and paler cyan text in dark mode, with the same pill shape, size and position.
Device and Browser Info
Playwright device projects (Mobile Chrome / Pixel 5, Mobile Safari / iPhone 12, Tablet / iPad Mini) against the local site at
http://localhost:8882/.Scope and exclusions
theme.jsonorstyles/dark.jsonchanges, and no new tokens.text.brandon a brand tint were not audited here and may need the same fix.Accessibility notes
Linked Stories/Tasks/PRs
Test plan
php -l patterns/sections/homepage-where-to-fit.phpreports no syntax errorsnpm run lintpasses (all JSON valid)npm run security:scanpassesnpm run theme:validatecompletes with one existing warning, unrelated to this change ({{PLACEHOLDER}}in.github/prompts/cleanup.prompt.md)mobile-menuspec on the local site in dark mode, Mobile Chrome, Mobile Safari and Tablet: 100 passed, 0 failed, 26 skipped (Chromium-only tests)mobile-menuspec on the local site in light mode, same three projects: 100 passed, 0 failed, 26 skippedmobile-menuspec on DEV once this is deployedChangelog
meta:needs-changelogapplies: this is a user-facing accessibility fix. The entry is added after this PR is created, so it can link here.Definition of Done
fix/)Summary by CodeRabbit