Theme system:
- Two-layer architecture: mode (light/dark/system via next-themes) + theme family (color palette via CSS variables)
- 12 theme families: Default, GitHub, Rosé Pine, Tokyo Night, Everforest, Nord, Kanagawa, Night Owl, Poimandres, Vesper, Horizon, SynthWave '84
- Per-family code block highlighting for Prism, HLJS, and Shiki (no more generic oneLight/oneDark fallback)
- Anti-FOUC: synchronous script in <head> reads localStorage and sets data-theme-family before paint
- Theme JSON files in themes/ directory, auto-discovered by server-side loader
- OKLCH color space for all values; CSS specificity html[data-theme-family] beats :root
UI changes:
- NavRail: moved Settings to bottom (replacing theme toggle), removed light/dark toggle button
- Settings: merged General controls into one card with dividers; Appearance section with live Shiki code preview
- Replaced hardcoded blue-500/blue-600 with primary/primary-foreground across 19 components
- Appearance settings: pill mode selector (light/dark/system), theme family dropdown, live code preview
New files:
- src/lib/theme/{types,loader,render-css,context,code-themes}.ts — core theme infrastructure
- src/components/layout/ThemeFamilyProvider.tsx — client context provider
- src/components/settings/AppearanceSection.tsx — appearance settings UI
- src/hooks/useAppTheme.ts — combined theme hook
- themes/*.json — 12 theme family definitions
- docs/handover/theme-system.md — handover documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
81 lines
3.1 KiB
JSON
81 lines
3.1 KiB
JSON
{
|
|
"id": "default",
|
|
"label": "Default",
|
|
"order": 0,
|
|
"description": "The default CodePilot color scheme",
|
|
"codeTheme": {
|
|
"light": "oneLight",
|
|
"dark": "oneDark"
|
|
},
|
|
"shikiTheme": {
|
|
"light": "github-light",
|
|
"dark": "github-dark"
|
|
},
|
|
"light": {
|
|
"background": "oklch(1 0 0)",
|
|
"foreground": "oklch(0.147 0.004 49.25)",
|
|
"card": "oklch(1 0 0)",
|
|
"cardForeground": "oklch(0.147 0.004 49.25)",
|
|
"popover": "oklch(1 0 0)",
|
|
"popoverForeground": "oklch(0.147 0.004 49.25)",
|
|
"primary": "oklch(0.546 0.245 262.881)",
|
|
"primaryForeground": "oklch(0.985 0.001 106.423)",
|
|
"secondary": "oklch(0.97 0.001 106.424)",
|
|
"secondaryForeground": "oklch(0.216 0.006 56.043)",
|
|
"muted": "oklch(0.97 0.001 106.424)",
|
|
"mutedForeground": "oklch(0.553 0.013 58.071)",
|
|
"accent": "oklch(0.97 0.001 106.424)",
|
|
"accentForeground": "oklch(0.216 0.006 56.043)",
|
|
"destructive": "oklch(0.577 0.245 27.325)",
|
|
"border": "oklch(0.923 0.003 48.717)",
|
|
"input": "oklch(0.923 0.003 48.717)",
|
|
"ring": "oklch(0.546 0.245 262.881)",
|
|
"chart1": "oklch(0.546 0.245 262.881)",
|
|
"chart2": "oklch(0.6 0.118 184.704)",
|
|
"chart3": "oklch(0.398 0.07 227.392)",
|
|
"chart4": "oklch(0.828 0.189 84.429)",
|
|
"chart5": "oklch(0.769 0.188 70.08)",
|
|
"sidebar": "oklch(0.985 0.001 106.423)",
|
|
"sidebarForeground": "oklch(0.147 0.004 49.25)",
|
|
"sidebarPrimary": "oklch(0.546 0.245 262.881)",
|
|
"sidebarPrimaryForeground": "oklch(0.985 0.001 106.423)",
|
|
"sidebarAccent": "oklch(0.97 0.001 106.424)",
|
|
"sidebarAccentForeground": "oklch(0.216 0.006 56.043)",
|
|
"sidebarBorder": "oklch(0.923 0.003 48.717)",
|
|
"sidebarRing": "oklch(0.546 0.245 262.881)"
|
|
},
|
|
"dark": {
|
|
"background": "oklch(0.147 0.004 49.25)",
|
|
"foreground": "oklch(0.985 0.001 106.423)",
|
|
"card": "oklch(0.216 0.006 56.043)",
|
|
"cardForeground": "oklch(0.985 0.001 106.423)",
|
|
"popover": "oklch(0.216 0.006 56.043)",
|
|
"popoverForeground": "oklch(0.985 0.001 106.423)",
|
|
"primary": "oklch(0.623 0.214 259.815)",
|
|
"primaryForeground": "oklch(0.985 0.001 106.423)",
|
|
"secondary": "oklch(0.268 0.007 34.298)",
|
|
"secondaryForeground": "oklch(0.985 0.001 106.423)",
|
|
"muted": "oklch(0.268 0.007 34.298)",
|
|
"mutedForeground": "oklch(0.709 0.01 56.259)",
|
|
"accent": "oklch(0.268 0.007 34.298)",
|
|
"accentForeground": "oklch(0.985 0.001 106.423)",
|
|
"destructive": "oklch(0.704 0.191 22.216)",
|
|
"border": "oklch(1 0 0 / 10%)",
|
|
"input": "oklch(1 0 0 / 15%)",
|
|
"ring": "oklch(0.623 0.214 259.815)",
|
|
"chart1": "oklch(0.623 0.214 259.815)",
|
|
"chart2": "oklch(0.696 0.17 162.48)",
|
|
"chart3": "oklch(0.769 0.188 70.08)",
|
|
"chart4": "oklch(0.627 0.265 303.9)",
|
|
"chart5": "oklch(0.645 0.246 16.439)",
|
|
"sidebar": "oklch(0.216 0.006 56.043)",
|
|
"sidebarForeground": "oklch(0.985 0.001 106.423)",
|
|
"sidebarPrimary": "oklch(0.623 0.214 259.815)",
|
|
"sidebarPrimaryForeground": "oklch(0.985 0.001 106.423)",
|
|
"sidebarAccent": "oklch(0.268 0.007 34.298)",
|
|
"sidebarAccentForeground": "oklch(0.985 0.001 106.423)",
|
|
"sidebarBorder": "oklch(1 0 0 / 10%)",
|
|
"sidebarRing": "oklch(0.623 0.214 259.815)"
|
|
}
|
|
}
|