-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Issue
Documentation pages accessibility tests are currently disabled for the color-contrast rule due to violations from syntax highlighting and muted text styling.
Problem
Two main sources of color contrast violations:
-
Shiki syntax highlighting: Code syntax highlighting spans with inline CSS variables (
--shiki-lightand--shiki-dark) may not always meet the WCAG 2 AA minimum contrast ratio of 4.5:1 in both light and dark themes. -
Fumadocs-ui muted foreground: Fumadocs-ui uses muted foreground colors for secondary text (e.g.,
text-fd-muted-foreground,text-sm.text-fd-muted-foreground) that fall slightly below the 4.5:1 contrast threshold. This includes:- Code block captions (
figcaption.flex-1.truncate) - Card descriptions (
p.text-fd-muted-foreground)
- Code block captions (
Impact: SERIOUS accessibility violation
Location
Affects documentation pages:
- Quickstart page (
/docs/quickstart) - Main docs pages (
/docs,/docs/examples,/docs/morphs) - Integration pages (
/docs/integrations/vscode,/docs/integrations/jetbrains)
Test files:
tooling/playwright-www/tests/quickstart.test.ts:192tooling/playwright-www/tests/docs-navigation.test.ts:202, 233tooling/playwright-www/tests/accessibility.test.ts:208
Current Workaround
The rule is temporarily disabled in accessibility tests:
disableRules: ["color-contrast"]Potential Solutions
- Theme color adjustment: Update shiki theme colors to ensure 4.5:1 contrast in both light and dark modes
- Fumadocs-ui styling override: Override fumadocs-ui muted foreground colors to meet contrast requirements
- Custom syntax highlighting: Use a custom shiki configuration with higher-contrast color schemes
- CSS custom properties: Adjust CSS variables for muted foreground colors to improve contrast while maintaining design intent
Related
This is tracked in accessibility tests with:
// TODO: Fix color-contrast - shiki syntax highlighting spans and fumadocs-ui muted foreground text
// Code syntax highlighting uses theme colors that may not always meet 4.5:1 contrast in both themes