Repository navigation
fix: raise muted and destructive ink to 4.5:1 in the light theme - #78
Merged
Merged
Conversation
…ight --muted-foreground moves from neutral-500 to neutral-600 and --destructive from #e60000 to red-700 in the light theme. Dark is unchanged. tokens.test.ts now asserts 4.5:1 for the ink/surface pairs components paint, in both themes. The #60 exception is removed from the axe audit, DESIGN.md records the decision, and 32 light-theme baselines are updated. Closes #60
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
Two colour roles fell below WCAG 1.4.3's 4.5:1 in the light theme: muted text on muted surfaces, and destructive ink on its own tint. Both roles change in
styles.cssonly, with no component class touched. The axe exception for #60 is gone, and 70 contrast assertions now hold the pairs in both themes.Closes #60
Values (light only; dark already passed and is unchanged)
--muted-foreground#737373#525252#f5f5f54.34 → 7.15; on#f3f3f34.26 → 7.03; on the destructive tint 4.33 → 7.14--destructive#e60000/10tint 4.03 → 5.33; on white 6.42In dark,
muted-foregroundonmutedis 5.83, anddestructiveon its/20tint is 4.63–5.3.Decisions (please look at the first one)
The issue suggested something between 500 and 600. A
color-mixof the two reaches 5.47:1, but Tailwind emits an@supportsfallback for it in every consumer's:root, which broke the packed-consumer test.The two options:
oklch(0.51 0 0)(≈5.4:1 on the tightest surface), asstyles.cssalready does for--brandand--destructive-foreground.This PR takes neutral-600. If you'd rather keep muted text lighter, it's a one-line change plus regenerating the baselines.
Changes
src/theme/styles.css: the two roles.tests/theme/contrast.ts(new): resolves oklch,var()and alpha, and computes the WCAG ratio.tests/theme/tokens.test.ts: 70 assertions in both themes.-surface,muted-foregroundon seven surfaces and tints, anddestructiveon its tint.tests/browser/a11y.spec.ts: the [a11y] Colour roles: muted text on muted surfaces and destructive ink on its tint fall below 4.5:1 (light) #60 exception and the list of low-contrast pairs are removed. The [22] CMP-01 · CodeBlock: audit the language switcher and choose its foundation #35 entries for CodeBlock's line numbers atmuted-foreground/70stay.tests/package/consumer.test.ts: expects neutral-600.test:visual:updaterewrote nothing, because each change is under the 0.2% pixel tolerance. The baselines were forced with--update-snapshots=all.Testing evidence
pnpm test: 349 tests plus 1 expected fail.pnpm test:package: 15/15.pnpm test:visual: 74/74.docs:checkpass.Limitations
/20) on the white page is 4.38:1 in light. It is transient, and axe doesn't measure it. Clearing it needs red-800 or a different hover recipe; DESIGN.md notes it.