Skip to content

a11y: Fix text contrast below WCAG AA - #1995

Merged
marcleblanc2 merged 2 commits into
mainfrom
marc/a11y/color-contrast
Sep 17, 2026
Merged

marcleblanc2 merged 2 commits into
mainfrom
marc/a11y/color-contrast

Conversation

@marcleblanc2

Copy link
Copy Markdown
Contributor

Problem

axe-core flags color-contrast violations (impact: serious) on every page: 13 on the home page in light mode, plus more on docs pages and in dark mode. WCAG AA needs 4.5:1 for body-size text.

Fix

Ratios are against the page background (#fffcfc light, #060000 / #0e0808 dark).

Text Before After
Bold text, light mode (Prose.tsx) vermilion-08 #FF7867, 2.5:1 new vermilion-05 #B80000, 6.8:1
Bold text, dark mode vermilion-08, 7.7:1 unchanged
Active breadcrumb / TOC entry / sidebar link (link.light token) vermilion-07 #F34E3F, 3.4:1 vermilion-06 #DA251B, 4.8:1
Breadcrumb links, dark mode gray-500, 4.3:1 gray-400, 8.2:1
"Search docs..." placeholder, dark mode slate-500, 4.2:1 slate-400, 7.8:1
⌘K shortcut hint, light / dark slate-400 2.5:1 / slate-600 2.6:1 slate-500 4.7:1 / slate-400 7.8:1

Vermilion-05 and -06 are the values from client/web/src/SourcegraphWebApp.scss in sourcegraph/sourcegraph. Also fixes the link token comments in tailwind.config.ts, which said Teal for Vermilion values.

Verification

axe-core 4.12 via Playwright against a local next dev, on / and /admin/audit-log, light and dark: color-contrast goes from 13 / 1 / 2 / 2 nodes to 0 on all four.

Bold text before and after, light mode:

before after
rgb(255, 120, 103) coral rgb(184, 0, 0) red

Part of a set of three a11y PRs; the other two fix button-name and landmark-one-main / region.

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sourcegraph-docs Ignored Ignored Preview Sep 17, 2026 10:09am UTC

Request Review

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

This comment has been minimized.

@marcleblanc2 marcleblanc2 changed the title a11y: Fix text colour contrast below WCAG AA a11y: Fix text contrast below WCAG AA Sep 17, 2026
@marcleblanc2
marcleblanc2 marked this pull request as ready for review September 17, 2026 09:09
@marcleblanc2
marcleblanc2 requested review from a team and enriquegh September 17, 2026 09:10
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) September 17, 2026 09:56
marcleblanc2 and others added 2 commits September 17, 2026 04:09
axe-core color-contrast violations (serious), with the ratio on the
page background before and after:

- Bold text in light mode: vermilion-08 #FF7867 (2.5:1) to a new
  vermilion-05 #B80000 (6.8:1). Dark mode keeps vermilion-08 (7.7:1)
- Active breadcrumb, TOC entry and sidebar link (link.light token):
  vermilion-07 #F34E3F (3.4:1) to vermilion-06 #DA251B (4.8:1)
- Breadcrumb links in dark mode: gray-500 (4.3:1) to gray-400 (8.2:1)
- Search button placeholder in dark mode: slate-500 (4.2:1) to
  slate-400 (7.8:1)
- Search shortcut hint: slate-400 (2.5:1) to slate-500 (4.7:1) in
  light mode, slate-600 (2.6:1) to slate-400 (7.8:1) in dark mode

Also corrects the link token comments, which said Teal for Vermilion
values.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ae7e-ae2c-7423-be36-eb9c5884b1e0
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 force-pushed the marc/a11y/color-contrast branch from 5f4a2a7 to 1779a37 Compare September 17, 2026 10:09
@marcleblanc2
marcleblanc2 merged commit 1842365 into main Sep 17, 2026
6 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/a11y/color-contrast branch September 17, 2026 10:09
@marcleblanc2

Copy link
Copy Markdown
Contributor Author

From the docs site audit (crawl of all 502 pages).

One contrast finding this PR did not cover: the code-comment colour in the syntax theme, #B362FF on #2d2b55, is 3.84:1 (554 nodes flagged on /admin/config/site-config alone). Everything else the crawl flagged (bold <strong>, breadcrumb current item, ⌘K hint) is fixed here.

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.

2 participants