Skip to content

fix(claude): theme new Claude Design System components#2285

Open
typedrat wants to merge 1 commit into
catppuccin:mainfrom
typedrat:typedrat/fix-claude-cds-theming
Open

fix(claude): theme new Claude Design System components#2285
typedrat wants to merge 1 commit into
catppuccin:mainfrom
typedrat:typedrat/fix-claude-cds-theming

Conversation

@typedrat

@typedrat typedrat commented Jul 5, 2026

Copy link
Copy Markdown

🔧 What does this fix? 🔧

Claude.ai now renders dropdowns, tooltips, dialogs, popovers, banners, and all of Claude Code (file viewer, diff viewer, buttons, HUD, sidebar) through internal component systems that define their own independent CSS custom properties — entirely separate from the --bg-*/--text-*/--accent-* variables this userstyle already themes. This PR covers four separate but related root causes:

1. Claude Code isn't matched at all. claude.ai/code renders its entire UI inside a cross-origin iframe served from a.claude.ai/isolated-segment.html. The @-moz-document rule only named claude.ai, so userstyle managers may never inject into that frame — this is why some users saw Claude Code completely unstyled, not just missing the newer component systems below. Fixed by adding domain("a.claude.ai") to the rule.

2. "Claude Design System" (.cds-root) — used for dropdowns, tooltips, dialogs/modals, popovers, and banners across claude.ai and Claude Code. Its tokens weren't touched by the existing overrides, so the account menu, model picker, Settings modal (all tabs), tooltips, and notification/limit banners rendered with Claude's raw default colors instead of Catppuccin. Covers:

  • Surfaces (--cds-surface-0..3, -panel, -popover)
  • Text hierarchy (primary/secondary/muted/disabled/accent/danger/success/warning/pro/git-status)
  • Backgrounds, borders, and fills for the accent/danger/success/warning/pro semantic family
  • "On-color" contrast text used on solid buttons (--cds-on-*)
  • Chart colors (categorical, sequential, diverging, status, axis/baseline/grid) — previously left out under the assumption they were covered by a separate tracked issue, folded in here since it's the same root cause
  • Focus ring glow, which was hardcoded to blue regardless of accent choice
  • The segmented-control toggle (used by the Appearance system/light/dark switcher)
  • Brand orange (--cds-clay), recolored to match the accent for consistency with the existing logo-color override

3. "Epitaxy" (.epitaxy-root) — a broader internal design system wrapping the entirety of Claude Code. Nearly everything (panels, popovers, HUD, sliders, switches, tooltips, button depth colors, the diff viewer, menus) derives from a --z0..--z6 surface ramp and a --t0..--t9 text-opacity ladder via var(), so overriding those primitives directly (rather than each individual leaf token) fixes the whole dependency graph at once. Also explicitly overrides a handful of dark-mode-only literals that bypass that ramp entirely:

  • --surface-primary-elevated, --surface-prompt-blur, --surface-prompt-focus-hover (the chat compose box)
  • --core-red/--core-red-hover (destructive-action red, was Claude's own red regardless of theme)
  • --accent-brand (used both as hsl(from ...)/relative-color syntax and directly via an inline fill: var(--accent-brand) style on the sparkle/logo glyph — needs a real color, not an H S% L% triple)

4. .dframe-root/.dframe-sidebar — a further-nested scope (used by Claude Code's sidebar and card components) that re-declares --df-sidebar-bg/--df-surface-primary a second time, directly on .dframe-sidebar itself, shadowing whatever .dframe-root says. Fixed by overriding at the actual point of shadowing rather than the ancestor.

Closes #2171.
Closes #2261.

Verification

  • Compiled the modified LESS locally against the real lib.less for all 4 flavors, light and dark, and against a local checkout of the actual site's CSS bundles (c6a992d55-CxTHAcqo.css for CDS, c1f7a9f2d-2jd2YVVi.css for Epitaxy/dframe) to build the token maps from ground truth rather than guessing from sampled runtime values.
  • Ran the repo's own deno task lint — passes clean.
  • Injected the compiled CSS live on claude.ai and claude.ai/code and confirmed:
    • The account menu, model picker, and every Settings tab render fully in Catppuccin, with no stray unthemed text colors on any leaf text node (scanned computed styles across each panel).
    • Claude Code's sidebar, file/diff panel surfaces, and text-opacity ladder now follow the chosen flavor instead of Epitaxy's default neutral gray + blue accent.
    • The a.claude.ai frame is genuinely cross-origin (confirmed via a blocked contentDocument access), explaining why some users saw zero theming there before the domain fix.
    • The sparkle/logo glyph (inline fill: var(--accent-brand)) renders in the accent color instead of falling back to black from an invalid triple value.

🗒 Checklist 🗒

@typedrat typedrat requested a review from ruiiiijiiiiang as a code owner July 5, 2026 17:25
@github-actions github-actions Bot added the claude Claude label Jul 5, 2026
@uncenter

uncenter commented Jul 5, 2026

Copy link
Copy Markdown
Member

Thanks for your contribution! Was this pull request made with the assistance of LLM tools? That needs to be disclosed as per our pull request template: https://github.com/catppuccin/userstyles/blob/main/.github/PULL_REQUEST_TEMPLATE/userstyle-update.md.

@typedrat

typedrat commented Jul 5, 2026

Copy link
Copy Markdown
Author

Yes, it was, sorry -- I tried to get Claude to draft a PR description for me and it just created the PR unbidden instead. I had it help me pick apart the CSS changes using Claude in Chrome, and it was trivial to write the patch by just treating the existing user styles as a mapping from old colors to new ones and applying that to the classes that weren't yet covered.

Claude.ai now renders dropdowns, tooltips, dialogs, popovers, banners,
and all of Claude Code (file viewer, diff viewer, buttons, HUD,
sidebar) through internal component systems with their own CSS custom
properties, entirely separate from the --bg-*/--text-*/--accent-*
variables this userstyle already themes:

- "Claude Design System" (.cds-root) -- used across claude.ai and
  Claude Code for overlays. Maps its surface/text/border/fill/on-color/
  git-status/chart tokens onto the palette.
- "Epitaxy" (.epitaxy-root) -- the broader design system wrapping all
  of Claude Code. Overrides the --z0..--z6 surface ramp and --t0..--t9
  text-opacity ladder that nearly everything else derives from, plus
  a few dark-mode-only literals that bypass that ramp (prompt/compose
  box, destructive-action red, brand accent).
- .dframe-root/.dframe-sidebar -- re-declares surface tokens a second
  time closer to the sidebar itself, shadowing the .epitaxy-root-level
  override; fixed at the point of shadowing.

Also fixes @-moz-document to match a.claude.ai, since Claude Code
renders its entire UI inside a cross-origin iframe on that subdomain
that the existing claude.ai-only rule never reached.

Closes catppuccin#2261.
@typedrat typedrat force-pushed the typedrat/fix-claude-cds-theming branch from 0ab3dae to 843fc15 Compare July 5, 2026 20:41
@uncenter

uncenter commented Jul 5, 2026

Copy link
Copy Markdown
Member

1. Claude Code isn't matched at all. claude.ai/code renders its entire UI inside a cross-origin iframe served from a.claude.ai/isolated-segment.html. The @-moz-document rule only named claude.ai, so userstyle managers may never inject into that frame — this is why some users saw Claude Code completely unstyled, not just missing the newer component systems below. Fixed by adding domain("a.claude.ai") to the rule.

I don't think this is true. domain("claude.ai") should also apply to any subdomain of claude.ai, in my experience.

@uncenter

uncenter commented Jul 6, 2026

Copy link
Copy Markdown
Member

@scarcekoi would you be able to confirm that this fixes all of your issues in #2171?

@scarcekoi

scarcekoi commented Jul 6, 2026

Copy link
Copy Markdown
Member

It looks like the graphs and charts remain unthemed:
image
But most of my issues in #2261 have been fixed, although the warning notification is still hard to read:
image

@uncenter uncenter added the 2.status: changes-requested Changes requested by reviewers must be attended to by author before further review label Jul 8, 2026
@typedrat

typedrat commented Jul 8, 2026

Copy link
Copy Markdown
Author

I don't really use the charts. Can you tell me how to bring one up? I was being optimistic based on the CSS variable names. 😅

@scarcekoi

Copy link
Copy Markdown
Member

I'm pretty sure they're technically on another website, but when I tried to theme them, I just could not get it to work: 884083d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: changes-requested Changes requested by reviewers must be attended to by author before further review claude Claude

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude: Unthemed Elements Claude: Graphs/Charts Unthemed

3 participants