Skip to content

Fix WCAG AA color contrast on important/seealso/tip admonition titles - #332

Merged
thibaudcolas merged 4 commits into
mainfrom
copilot/fix-accessibility-color-contrast
Jul 7, 2026
Merged

Fix WCAG AA color contrast on important/seealso/tip admonition titles#332
thibaudcolas merged 4 commits into
mainfrom
copilot/fix-accessibility-color-contrast

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The .important, .seealso, and .tip admonition title backgrounds used $success: #a456c9 — a purple that yields only 4.41:1 contrast with white text, just below the WCAG 2 AA threshold of 4.5:1.

Change

Darken $success by 3% lightness in sass/_variables.scss:

// Before
$success: #a456c9;

// After
$success: color.adjust(#a456c9, $lightness: -3%); // compiles to #9e4ac5

This brings the contrast ratio to 4.95:1 with white text. The fix applies to both light and dark mode — the admonition title background uses $success directly in both (only the outer container is overridden by $darkmode-success). All other components using $success (version badges, bignums) benefit equally.

Darken $success color from #a456c9 to color.adjust(#a456c9, $lightness: -3%)
(compiles to #9e4ac5), improving contrast ratio with white text from 4.41:1
to 4.95:1, meeting WCAG 2 AA minimum of 4.5:1.

Fixes #326 - affects .important, .seealso, .tip admonition titles in both
light and dark mode (both use $success as the title background color).
Copilot AI changed the title [WIP] Fix accessibility issue: Improve color contrast on admonitions Fix WCAG AA color contrast on important/seealso/tip admonition titles Jul 3, 2026
Copilot AI requested a review from thibaudcolas July 3, 2026 13:54
@thibaudcolas

Copy link
Copy Markdown
Member

@copilot looking good, pls rebase and add a release note entry

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot looking good, pls rebase and add a release note entry

Done — rebased onto main and added the CHANGELOG entry under Unreleased > Fixed in e1f4bca.

@thibaudcolas
thibaudcolas marked this pull request as ready for review July 7, 2026 08:52
@thibaudcolas
thibaudcolas merged commit 74f2e65 into main Jul 7, 2026
3 of 4 checks passed
@thibaudcolas
thibaudcolas deleted the copilot/fix-accessibility-color-contrast branch July 7, 2026 08:52
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.

Accessibility issue: Elements must meet minimum color contrast ratio thresholds on /en/latest/examples/admonitions.html

2 participants