[Bug]: Built-in dark themes other than t3-chat have low muted-text contrast and fail WCAG AA on elevated surfaces #42259
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- Open T3 Code Desktop/Web in Dark appearance with default Contrast (
Settings → Appearance → Contrastat default). - Switch through all 6 built-in themes:
t3-code,t3-chat,grove,ocean,ember, andiris. - Inspect secondary/muted UI text across:
- Canvas / main view (
textMuted,mutedForeground,secondaryLabel,iconMuted) - Sidebar thread list metadata (
sidebarMutedForegroundonsidebar,sidebarRowHover,sidebarRowActive,sidebarRowSelected, andsidebarControlSurface) - Popovers/overlays (
textMutedonsurfaceOverlay) and secondary labels inside message bubbles (mutedForegroundonmessageSurface) - Semi-transparent muted text utilities used in the UI (e.g.
text-muted-foreground/70,/60)
- Canvas / main view (
Expected behavior#
All 6 built-in dark themes should have consistent, comfortable text legibility comparable to t3-chat, meeting at least WCAG 2.1 AA (4.5:1) across both base and elevated/interactive surfaces (and ideally APCA ≥ Lc 60 for secondary 12–14px UI text in dark mode).
Actual behavior#
Among the 6 built-in dark themes, only t3-chat (pink) provides high contrast for secondary/muted UI text. The other 5 themes (t3-code, grove, ocean, ember, iris) have noticeably low readability, and the 4 colored themes (grove, ocean, ember, iris) fail WCAG 2.1 AA (4.5:1) — and even drop below 3.0:1 — on elevated/interactive surfaces:
Measured Dark-Mode Contrast (WCAG 2.1 ratio / APCA |Lc|)#
| Foreground / Background Pair | t3-code | t3-chat | grove | ocean | ember | iris |
|---|---|---|---|---|---|---|
text / canvas (primary body) | 18.16 / Lc 101 | 16.12 / Lc 102 | 14.91 / Lc 103 | 15.82 / Lc 103 | 15.78 / Lc 103 | 16.65 / Lc 104 |
textMuted / canvas | 5.08 / Lc 35 | 11.75 / Lc 80 | 5.08 / Lc 42 | 5.08 / Lc 40 | 5.09 / Lc 40 | 5.08 / Lc 39 |
sidebarMutedForeground / sidebar | 8.33 / Lc 52 | 12.87 / Lc 81 | 5.08 / Lc 46 | 5.08 / Lc 44 | 5.08 / Lc 44 | 5.08 / Lc 42 |
sidebarMutedForeground / sidebarRowSelected | 7.49 / Lc 52 | 11.62 / Lc 80 | 2.98 ❌ / Lc 35 | 3.12 ❌ / Lc 35 | 3.16 ❌ / Lc 35 | 3.50 ❌ / Lc 35 |
sidebarMutedForeground / sidebarRowActive | 6.84 / Lc 51 | 11.62 / Lc 80 | 3.27 ❌ / Lc 37 | 3.40 ❌ / Lc 37 | 3.43 ❌ / Lc 37 | 3.74 ❌ / Lc 37 |
sidebarMutedForeground / sidebarControlSurface | 7.85 / Lc 52 | 11.62 / Lc 80 | 3.10 ❌ / Lc 36 | 3.08 ❌ / Lc 34 | 3.08 ❌ / Lc 34 | 3.08 ❌ / Lc 33 |
textMuted / surfaceOverlay | 4.85 / Lc 35 | 13.50 / Lc 82 | 2.87 ❌ / Lc 31 | 2.88 ❌ / Lc 30 | 2.88 ❌ / Lc 30 | 2.91 ❌ / Lc 30 |
mutedForeground / messageSurface | 4.73 / Lc 35 | 10.34 / Lc 79 | 2.63 ❌ / Lc 32 | 2.74 ❌ / Lc 32 | 2.77 ❌ / Lc 32 | 3.07 ❌ / Lc 32 |
mutedForeground / secondary | 4.85 / Lc 35 | 9.04 / Lc 77 | 3.89 ❌ / Lc 42 | 3.95 ❌ / Lc 40 | 3.96 ❌ / Lc 40 | 4.10 ❌ / Lc 38 |
text-muted-foreground/70 on canvas | 3.02 ❌ / Lc 19 | 6.38 / Lc 48 | 3.75 ❌ / Lc 31 | 3.62 ❌ / Lc 28 | 3.60 ❌ / Lc 28 | 3.40 ❌ / Lc 25 |
Root Cause Analysis#
- Muted foreground tokens are calibrated too dimly in dark mode:
t3-chatuses high-lightness muted text (oklch(0.880 0.031 342.7)/#e7d0dd).grove,ocean,ember, andirisappear to target a bare ~5.08:1 WCAG 2.1 ratio againstcanvas/sidebar(oklch L ≈ 0.64–0.71), andt3-codeuses#818181(L ≈ 0.60). Because WCAG 2.1 overestimates light-on-dark readability, ~5.08:1 translates to only APCA Lc 35–46 (well below the Lc 60 fluent UI text threshold).
- Elevated surfaces in
grove/ocean/ember/irisare significantly lighter than int3-chat:t3-chatkeepssurfaceOverlay(L=0.155),sidebarRowSelected(L=0.234), andmessageSurface(L=0.274) dark.grove/ocean/ember/irislift those surfaces to mid-tones (surfaceOverlay L=0.39–0.41,sidebarRowSelected L=0.37–0.44,sidebarControlSurface L=0.40–0.43,messageSurface L=0.40–0.47), causing muted text to drop to 2.63–3.50:1.
- Opacity modifiers compound the issue:
- UI components frequently apply Tailwind opacity modifiers (
text-muted-foreground/70,/60, etc.), which remain legible ont3-chat(6.38:1at 70%) but become barely visible (3.02–3.75:1, APCA Lc 19–31) on the other 5 themes.
- UI components frequently apply Tailwind opacity modifiers (
Suggested Fix#
- Raise dark-mode muted text lightness across
t3-code,grove,ocean,ember, andiris— targeting APCA ≥ Lc 60 (roughly WCAG ≥ 7.5–8.5:1 againstcanvas/sidebar,oklch L ≈ 0.78–0.85) fortextMuted,mutedForeground,secondaryLabel,iconMuted, andsidebarMutedForeground. - Darken elevated dark-mode surfaces (
sidebarRowSelected,sidebarRowActive,sidebarControlSurface,surfaceOverlay,messageSurface,secondary) ingrove,ocean,ember, andiris— or validate muted foreground contrast against the lightest interactive surface it appears on (requiring ≥ 4.5:1 WCAG AA / ≥ Lc 55–60 APCA).
Impact#
Minor bug or occasional failure
Version or commit#
0.1.11 @ 59651c1761f6
Environment#
Windows, T3 Code Desktop (Beta) v0.1.11
Workaround#
Switch to t3-chat in dark mode, raise Settings → Appearance → Contrast, or publish a custom theme with brighter muted-text roles and darker elevated surfaces.
tanstack-source added labelsbug
Still happens on v0.1.13 (latest stable), T3 Code Desktop (Beta) on Windows, Dark appearance, default Contrast.
Method: I read the dark palettes straight from the installed bundle (
themePalette-*.jsinserver.asar): the stock palette fort3-codeand each theme'svariants.darkfor the other five. Then I computed WCAG 2.1 contrast ratios with a small local script.Foreground / background t3-code t3-chat grove ocean ember iris textMuted/canvas5.08 11.75 5.06 5.05 5.07 5.08 sidebarMutedForeground/sidebar8.33 12.87 5.04 5.11 5.07 5.09 sidebarMutedForeground/sidebarRowSelected7.49 11.62 2.97 ❌ 3.12 ❌ 3.16 ❌ 3.51 ❌ sidebarMutedForeground/sidebarRowActive6.84 11.62 3.24 ❌ 3.41 ❌ 3.43 ❌ 3.72 ❌ sidebarMutedForeground/sidebarControlSurface7.85 11.62 3.08 ❌ 3.09 ❌ 3.10 ❌ 3.08 ❌ textMuted/surfaceOverlay4.85 13.50 2.89 ❌ 2.87 ❌ 2.90 ❌ 2.90 ❌ mutedForeground/messageSurface4.73 10.34 2.63 ❌ 2.72 ❌ 2.77 ❌ 3.08 ❌ mutedForeground/secondary4.85 9.04 3.85 ❌ 3.95 ❌ 3.94 ❌ 4.12 ❌ mutedForegroundat 70% /canvas3.01 ❌ 6.37 3.75 ❌ 3.60 ❌ 3.59 ❌ 3.40 ❌ ❌ = below 4.5:1 (AA, normal text).
Verdict: unchanged since 0.1.11. Every ratio matches the table in the issue within 0.04, and the APCA values within 1 Lc. The small gaps come from rounding in the oklch to sRGB conversion.
t3-chatpasses everywhere. grove, ocean, ember and iris still fail AA on every elevated surface. Stockt3-codefails only with the/70opacity modifier.The generator target from the follow-up comment (
5.082) is still in the 0.1.13 bundle too.
Sign in to join this conversation.
Follow-up: Exact Root Cause in the Palette Generator & Open VSX Importer#
Digging into the bundled theme palette code (
v0.1.11), this turns out to affect not only the other 5 built-in dark themes, but also imported Open VSX themes (even high-contrast ones like GitHub Dark High Contrast or Catppuccin Mocha):Hardcoded low dark-mode contrast targets in the palette generator:
5.082fortextMuted,secondaryLabel,iconMuted(againstcanvas) andsidebarMutedForeground(againstsidebar)4.6formutedForeground(againstmuted) andplaceholder(againstsurfaceRaised)4.6–5.082:1yields only APCA Lc 35–46 in dark mode.surfaceOverlay+0.075 L,secondary/sidebarControlSurface+0.10 L,sidebarRowActive+0.12 L,sidebarRowSelected+0.14 L,messageSurface+0.16 L) without checking muted-text contrast against those lighter surfaces—causing the2.63–3.95:1WCAG AA failures above.Open VSX theme importer leaves key muted-text roles unmapped:
hvia the same generator and merges{ ...h, ...O }.OmapstextMutedfrom VS Code'sdescriptionForeground/disabledForeground, but omitsmutedForeground,secondaryLabel,iconMuted, andsidebarMutedForeground.text-muted-foregroundand sidebar metadata in any imported Open VSX dark theme fall back to the dim4.6/5.082generated values, making them appear washed out too.t3-chatis effectively the only dark theme that bypasses this generator (#e7d0ddacross all muted text roles + darker elevated surfaces).Additional Fix Recommendation#
mutedForeground,secondaryLabel,iconMuted, andsidebarMutedForegroundfrom the imported theme's muted foreground / contrast-checked fallback instead of leaving them on the dim derived defaults.