Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Built-in dark themes other than t3-chat have low muted-text contrast and fail WCAG AA on elevated surfaces #42259

Openarchitect9331(GitHub profile, opens in a new tab) opened this issue 2 comments

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

  1. Open T3 Code Desktop/Web in Dark appearance with default Contrast (Settings → Appearance → Contrast at default).
  2. Switch through all 6 built-in themes: t3-code, t3-chat, grove, ocean, ember, and iris.
  3. Inspect secondary/muted UI text across:
    • Canvas / main view (textMuted, mutedForeground, secondaryLabel, iconMuted)
    • Sidebar thread list metadata (sidebarMutedForeground on sidebar, sidebarRowHover, sidebarRowActive, sidebarRowSelected, and sidebarControlSurface)
    • Popovers/overlays (textMuted on surfaceOverlay) and secondary labels inside message bubbles (mutedForeground on messageSurface)
    • Semi-transparent muted text utilities used in the UI (e.g. text-muted-foreground/70, /60)

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 Pairt3-codet3-chatgroveoceanemberiris
text / canvas (primary body)18.16 / Lc 10116.12 / Lc 10214.91 / Lc 10315.82 / Lc 10315.78 / Lc 10316.65 / Lc 104
textMuted / canvas5.08 / Lc 3511.75 / Lc 805.08 / Lc 425.08 / Lc 405.09 / Lc 405.08 / Lc 39
sidebarMutedForeground / sidebar8.33 / Lc 5212.87 / Lc 815.08 / Lc 465.08 / Lc 445.08 / Lc 445.08 / Lc 42
sidebarMutedForeground / sidebarRowSelected7.49 / Lc 5211.62 / Lc 802.98 ❌ / Lc 353.12 ❌ / Lc 353.16 ❌ / Lc 353.50 ❌ / Lc 35
sidebarMutedForeground / sidebarRowActive6.84 / Lc 5111.62 / Lc 803.27 ❌ / Lc 373.40 ❌ / Lc 373.43 ❌ / Lc 373.74 ❌ / Lc 37
sidebarMutedForeground / sidebarControlSurface7.85 / Lc 5211.62 / Lc 803.10 ❌ / Lc 363.08 ❌ / Lc 343.08 ❌ / Lc 343.08 ❌ / Lc 33
textMuted / surfaceOverlay4.85 / Lc 3513.50 / Lc 822.87 ❌ / Lc 312.88 ❌ / Lc 302.88 ❌ / Lc 302.91 ❌ / Lc 30
mutedForeground / messageSurface4.73 / Lc 3510.34 / Lc 792.63 ❌ / Lc 322.74 ❌ / Lc 322.77 ❌ / Lc 323.07 ❌ / Lc 32
mutedForeground / secondary4.85 / Lc 359.04 / Lc 773.89 ❌ / Lc 423.95 ❌ / Lc 403.96 ❌ / Lc 404.10 ❌ / Lc 38
text-muted-foreground/70 on canvas3.02 ❌ / Lc 196.38 / Lc 483.75 ❌ / Lc 313.62 ❌ / Lc 283.60 ❌ / Lc 283.40 ❌ / Lc 25

Root Cause Analysis

  1. Muted foreground tokens are calibrated too dimly in dark mode:
    • t3-chat uses high-lightness muted text (oklch(0.880 0.031 342.7) / #e7d0dd).
    • grove, ocean, ember, and iris appear to target a bare ~5.08:1 WCAG 2.1 ratio against canvas/sidebar (oklch L ≈ 0.64–0.71), and t3-code uses #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).
  2. Elevated surfaces in grove / ocean / ember / iris are significantly lighter than in t3-chat:
    • t3-chat keeps surfaceOverlay (L=0.155), sidebarRowSelected (L=0.234), and messageSurface (L=0.274) dark.
    • grove / ocean / ember / iris lift 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.
  3. Opacity modifiers compound the issue:
    • UI components frequently apply Tailwind opacity modifiers (text-muted-foreground/70, /60, etc.), which remain legible on t3-chat (6.38:1 at 70%) but become barely visible (3.02–3.75:1, APCA Lc 19–31) on the other 5 themes.

Suggested Fix

  1. Raise dark-mode muted text lightness across t3-code, grove, ocean, ember, and iris — targeting APCA ≥ Lc 60 (roughly WCAG ≥ 7.5–8.5:1 against canvas/sidebar, oklch L ≈ 0.78–0.85) for textMuted, mutedForeground, secondaryLabel, iconMuted, and sidebarMutedForeground.
  2. Darken elevated dark-mode surfaces (sidebarRowSelected, sidebarRowActive, sidebarControlSurface, surfaceOverlay, messageSurface, secondary) in grove, ocean, ember, and iris — 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.

  1. tanstack-source added labelsbug

  2. 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):

    1. Hardcoded low dark-mode contrast targets in the palette generator:

      • The palette derivation function blends foreground text toward the background until WCAG 2.1 contrast drops to two hardcoded dark-mode floors:
        • 5.082 for textMuted, secondaryLabel, iconMuted (against canvas) and sidebarMutedForeground (against sidebar)
        • 4.6 for mutedForeground (against muted) and placeholder (against surfaceRaised)
      • Because WCAG 2.1 overestimates light-on-dark readability, 4.6–5.082:1 yields only APCA Lc 35–46 in dark mode.
      • At the same time, the generator lifts interactive/elevated dark surfaces significantly (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 the 2.63–3.95:1 WCAG AA failures above.
    2. Open VSX theme importer leaves key muted-text roles unmapped:

      • When importing an Open VSX theme, T3 Code computes a base derived palette h via the same generator and merges { ...h, ...O }.
      • O maps textMuted from VS Code's descriptionForeground / disabledForeground, but omits mutedForeground, secondaryLabel, iconMuted, and sidebarMutedForeground.
      • Consequently, text-muted-foreground and sidebar metadata in any imported Open VSX dark theme fall back to the dim 4.6 / 5.082 generated values, making them appear washed out too.
      • Hand-crafted t3-chat is effectively the only dark theme that bypasses this generator (#e7d0dd across all muted text roles + darker elevated surfaces).

    Additional Fix Recommendation

    • Raise the dark-mode muted text contrast floor in the palette generator (e.g., APCA ≥ Lc 60 / WCAG ≥ 7.5–8.5:1) and constrain dark surface elevation (or verify muted contrast against the lightest interactive surface it is rendered on).
    • In the Open VSX theme importer, also populate mutedForeground, secondaryLabel, iconMuted, and sidebarMutedForeground from the imported theme's muted foreground / contrast-checked fallback instead of leaving them on the dim derived defaults.
  3. 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-*.js in server.asar): the stock palette for t3-code and each theme's variants.dark for the other five. Then I computed WCAG 2.1 contrast ratios with a small local script.

    Foreground / backgroundt3-codet3-chatgroveoceanemberiris
    textMuted / canvas5.0811.755.065.055.075.08
    sidebarMutedForeground / sidebar8.3312.875.045.115.075.09
    sidebarMutedForeground / sidebarRowSelected7.4911.622.97 ❌3.12 ❌3.16 ❌3.51 ❌
    sidebarMutedForeground / sidebarRowActive6.8411.623.24 ❌3.41 ❌3.43 ❌3.72 ❌
    sidebarMutedForeground / sidebarControlSurface7.8511.623.08 ❌3.09 ❌3.10 ❌3.08 ❌
    textMuted / surfaceOverlay4.8513.502.89 ❌2.87 ❌2.90 ❌2.90 ❌
    mutedForeground / messageSurface4.7310.342.63 ❌2.72 ❌2.77 ❌3.08 ❌
    mutedForeground / secondary4.859.043.85 ❌3.95 ❌3.94 ❌4.12 ❌
    mutedForeground at 70% / canvas3.01 ❌6.373.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-chat passes everywhere. grove, ocean, ember and iris still fail AA on every elevated surface. Stock t3-code fails only with the /70 opacity 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.