Skip to content

Secondary text falls below 4.5:1 contrast in both themes #15407

Description

@bpmore

Bug description

Grey secondary text at 13–14px falls under the 4.5:1 required by WCAG 2.1 SC 1.4.3 (Level AA) in both themes. None of it is large-scale text, so the 3:1 allowance does not apply.

Measured with axe-core against the resolved computed colours:

Ratio Element Foreground Background Size Where
4.24:1 "Check All" #71717b #f0f0f2 13px /cp/roles/create
3.48:1 "Pro" badge #ff269e #ffffff 14px bold /cp/utilities/licensing
3.67:1 tab label #71717b #18181b 14px dark theme
3.84:1 "1–3 of 3" pagination #71717b #131315 14px dark theme

Required: 4.50:1.

Three of the four are the same token — grey-500 (#71717b) — used for secondary text against both the light panel and the dark chrome. It clears 3:1 everywhere but never reaches 4.5:1.

The fourth is the brand pink used as text on the licensing screen.

How to reproduce

  1. composer create-project statamic/statamic, log in
  2. Visit /cp/roles/create in the light theme and check the "Check All" label
  3. Visit /cp/utilities/licensing and check the pink "Pro" label
  4. Switch to the dark theme and check a tab label and the listing pagination count

Or run axe-core with the color-contrast rule on those screens.

Suggested fix

  • Move secondary text from grey-500 to grey-600 in light and grey-400 in dark. #52525c on #f0f0f2 gives 7.4:1; #9f9fa9 on #131315 gives 7.9:1.
  • Give the pink a darker variant for text use and keep the current brand pink for fills and borders, where 3:1 is the bar.

Both are token changes rather than component changes, which is why I've filed this rather than opened a PR — the exact replacement values are a design call.

Note

Non-text contrast is a separate problem, reported in #15397. Fixing the text tokens here won't address the control borders there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions