Fix button.fill color contrast (LS-2937) - #41
Open
brandonmarshal wants to merge 5 commits into
Open
Conversation
Bug fix - Change button.fill background/border from brand-500 to brand-600, fixing a 4.41:1 contrast failure (needs 4.5:1) - Change text-hover from contrast to base, fixing a pre-existing hover-state contrast failure axe didn't catch (4.35:1)
Documentation - Document button.fill color contrast fix per repo convention
…x-button-fill-color-contrast # Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
🟡 Changes recommended
button.outline hover/rest token values remain on brand-500, which is likely to continue failing WCAG AA contrast for the secondary outline button style used in the theme.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes an accessibility colour-contrast failure by updating the theme’s semantic button colour tokens for the secondary filled button style.
Changes:
- Updated
settings.custom.color.button.fill.*tokens intheme.jsonfrombrand-500tobrand-600, and adjusted the hover text token to maintain WCAG AA contrast. - Added a detailed
[Unreleased]changelog entry documenting the contrast ratios and scope for LS-2937.
File summaries
| File | Description |
|---|---|
theme.json |
Adjusts button.fill custom colour tokens to improve WCAG AA contrast for the secondary filled button style. |
CHANGELOG.md |
Documents the accessibility fix and the computed contrast ratios under a new Unreleased entry. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bug fix - Change button.outline text/border/background-hover from brand-500 to brand-600, fixing a 4.41:1 contrast failure in both resting and hover states (Copilot review, PR #41) - Dark mode's outline tokens (cta-500/cta-400) already pass and are untouched
Documentation - Correct wrong contrast ratio (4.98:1 -> 5.34:1); resting and hover states share the same colour pair, not two different ones - Add missing outline-button fix entry, omitted from the original changelog entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An axe-core accessibility audit of LS-2937 flagged a WCAG AA color-contrast failure on the theme's secondary filled button style. This fixes it, along with a related hover-state failure and an outline-button variant of the same failure, both found while tracing the fix.
Color contrast — filled button
theme.json'sbutton.fill.background/borderwasbrand-500(#1E6AFF) againstbutton.fill.text(base,#FAFAFA) — 4.41:1, below the 4.5:1 minimum for normal text. This affects every use ofis-style-button-secondary: the 404 page's "Back to homepage" button, the Work archive's "Ready to discuss a project?" CTA, and the mobile menu's "Start a project" button.brand-600(#1C5EE4) — 5.34:1, passes with real margin. This isn't an arbitrary pick:brand-600is already the exact token used everywhere else this brand blue needs to be accessible (text.brand,link.accent/link.decoration-start,card.platform.wordpress), so this also removes a pre-existing inconsistency where buttons used a slightly different, non-accessible shade of the same blue than everything else.Hover-state contrast
text-hover(contrast,#080808, near-black) againstbackground-hover(the same blue) was already failing today at 4.35:1 — axe-core doesn't trigger:hoverstates, so the original BugHerd scan never caught it. Applying only the background swap above would have made this worse (3.6:1).text-hovertobase(white), matching the resting state's text color. Resting and hover now share the samebrand-600/basecolor pair, so both are 5.34:1.Color contrast — outline button
button.outline.text/border/background-hoverwere alsobrand-500, causing the same 4.41:1 failure onis-style-button-secondary-outlinein both its resting state (text on a transparent/light background) and hover state (white text on abrand-500background).brand-600— 5.34:1 in both states, consistent with the filled button fix above.Investigated, not changed
cta-500/cta-400againstcontrast), for both the filled and outline styles, were checked and already pass comfortably (15.57:1 resting, 13.1:1 hover) — no dark-mode change needed.ls-button-cta-gradientinpatterns/header.php) is unaffected by this change — it uses its own custom gradient background, notbutton.fill.background./blog/, ARIA link-name on 4 content pages, ARIA issues inside an embedded YouTube iframe) are out of scope for this PR: the blog color-contrast issue traced back to a value (text.brand=brand-600) that's already correct in this repo and appears to be a stale cache on the live dev site rather than a code bug; the ARIA link-name issues are content authored directly in post bodies, not theme code; and the YouTube iframe issues are entirely inside third-party embed markup this theme has no control over.Test plan
npm run lint:json— all JSON validbackground-color: rgb(28, 94, 228)(#1C5EE4, brand-600) andcolor: rgb(250, 250, 250)(base) — matches the intended fixPart of LS-2937 — this PR resolves the color-contrast portion only (task 237). LS-2937's other tasks (blog contrast cache issue, ARIA content fixes, third-party YouTube embed) remain open and are tracked separately; please don't auto-close the issue on merge.