feat: theming v2 with design tokens, theme files, and editor#115
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every color, radius, shadow, and font now resolves through a --cl-* custom property. Dark mode reassigns color tokens via the [data-claudius-dark] block instead of per-class dark: variants. Legacy --claudius-* properties stay first in each var() chain so existing external overrides keep winning. Default light/dark appearance is unchanged; accentColor now feeds --cl-color-accent (and therefore also the user bubble, which previously ignored it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
useTheme resolves the union: mode strings keep their existing meaning, built-in names map to bundled themes, other strings are fetched as theme JSON (falling back to defaults on any failure), and objects apply directly. accentColor still wins over the theme accent. Exports builtinThemes and the ClaudiusTheme types. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Source of truth lives next to the theme types; the byte-identical copy in docs/public/schema/ is served at https://claudius-docs.pages.dev/schema/theme.v1.json. AJV validates the built-ins and rejection cases in tests (dev-only dependency). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying chat-widget with
|
| Latest commit: |
193e760
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://be4c7392.chat-widget-ejc.pages.dev |
| Branch Preview URL: | https://73-theming-v2-design-tokens-wz5t.chat-widget-ejc.pages.dev |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #73
Summary
Upgrades the accent-color-only API to a full design-token system. Design doc:
docs/plans/2026-06-11-theming-v2-design.md.Acceptance criteria
--cl-*token (--cl-color-accent,--cl-color-surface,--cl-radius-md,--cl-shadow-elevated, ...). Dark mode reassigns color tokens via the[data-claudius-dark]block instead of hard-codeddark:utilities.widget/src/theme/theme.v1.schema.json, byte-identical copy (drift-guarded by a test) served athttps://claudius-docs.pages.dev/schema/theme.v1.jsonthe moment this merges (docs auto-deploy). The issue namedclaudius.dev, which is not attached yet — same "or equivalent" precedent as Replace README-heavy docs with a proper docs site (Astro Starlight) #74; the path carries over when the domain lands.theme: ClaudiusTheme | string— the prop now accepts mode strings (unchanged behavior), built-in names, inline theme objects, or a URL to a theme JSON file (fetched with abort/fallback; the widget never breaks on a bad theme URL).accentColorstill works and wins over the theme accent.default,minimal,playful,corporate, exported asbuiltinThemes, all schema-validated in tests./theme-editor/on the docs site with grouped token controls, light/dark preview, presets, and download/copy export. The issue placed this on the playground site, which does not exist yet (Public demo / playground site with live config editor #48/Public playground and demo site #83) — the docs site is its interim home and the editor moves when the playground lands./migration/accent-color-to-themes/plus a rewritten theming reference with the full token table.Compatibility
No breaking changes (the CDN
@1channel auto-updates, so this was a hard constraint):theme: "light" | "dark" | "auto",accentColor, and external--claudius-*overrides keep their exact behavior (legacy vars stay first in eachvar()chain and win)accentColor/theme accent (previously the header recolored but user bubbles stayed blue)Verification
🤖 Generated with Claude Code