Files
7418andClaude Opus 4.6 4da188bfe5 feat: theme family system with 12 color palettes + NavRail redesign
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>
2026-03-09 11:15:01 +08:00

81 lines
3.1 KiB
JSON

{
"id": "vesper",
"label": "Vesper",
"order": 9,
"description": "Warm monochrome palette with amber highlights",
"codeTheme": {
"light": "gruvboxLight",
"dark": "twilight"
},
"shikiTheme": {
"light": "min-light",
"dark": "vesper"
},
"light": {
"background": "oklch(0.980 0.005 78.3)",
"foreground": "oklch(0.344 0.007 48.5)",
"card": "oklch(0.945 0.009 78.3)",
"cardForeground": "oklch(0.344 0.007 48.5)",
"popover": "oklch(0.945 0.009 78.3)",
"popoverForeground": "oklch(0.344 0.007 48.5)",
"primary": "oklch(0.638 0.120 59.5)",
"primaryForeground": "oklch(0.980 0.005 78.3)",
"secondary": "oklch(0.909 0.015 80.7)",
"secondaryForeground": "oklch(0.344 0.007 48.5)",
"muted": "oklch(0.909 0.015 80.7)",
"mutedForeground": "oklch(0.617 0.009 56.2)",
"accent": "oklch(0.945 0.009 78.3)",
"accentForeground": "oklch(0.344 0.007 48.5)",
"destructive": "oklch(0.574 0.148 30.4)",
"border": "oklch(0.878 0.015 80.7)",
"input": "oklch(0.945 0.009 78.3)",
"ring": "oklch(0.638 0.120 59.5)",
"chart1": "oklch(0.638 0.120 59.5)",
"chart2": "oklch(0.646 0.103 186.6)",
"chart3": "oklch(0.574 0.148 30.4)",
"chart4": "oklch(0.564 0.186 311.7)",
"chart5": "oklch(0.582 0.156 263.2)",
"sidebar": "oklch(0.945 0.009 78.3)",
"sidebarForeground": "oklch(0.344 0.007 48.5)",
"sidebarPrimary": "oklch(0.638 0.120 59.5)",
"sidebarPrimaryForeground": "oklch(0.980 0.005 78.3)",
"sidebarAccent": "oklch(0.909 0.015 80.7)",
"sidebarAccentForeground": "oklch(0.344 0.007 48.5)",
"sidebarBorder": "oklch(0.878 0.015 80.7)",
"sidebarRing": "oklch(0.638 0.120 59.5)"
},
"dark": {
"background": "oklch(0.173 0.000 89.9)",
"foreground": "oklch(0.779 0.000 89.9)",
"card": "oklch(0.226 0.000 89.9)",
"cardForeground": "oklch(0.779 0.000 89.9)",
"popover": "oklch(0.226 0.000 89.9)",
"popoverForeground": "oklch(0.779 0.000 89.9)",
"primary": "oklch(0.869 0.088 60.7)",
"primaryForeground": "oklch(0.173 0.000 89.9)",
"secondary": "oklch(0.277 0.000 89.9)",
"secondaryForeground": "oklch(0.779 0.000 89.9)",
"muted": "oklch(0.277 0.000 89.9)",
"mutedForeground": "oklch(0.528 0.000 89.9)",
"accent": "oklch(0.226 0.000 89.9)",
"accentForeground": "oklch(0.779 0.000 89.9)",
"destructive": "oklch(0.788 0.103 31.3)",
"border": "oklch(0.277 0.000 89.9)",
"input": "oklch(0.226 0.000 89.9)",
"ring": "oklch(0.869 0.088 60.7)",
"chart1": "oklch(0.869 0.088 60.7)",
"chart2": "oklch(0.930 0.103 175.1)",
"chart3": "oklch(0.783 0.111 278.4)",
"chart4": "oklch(0.833 0.093 19.2)",
"chart5": "oklch(0.832 0.092 293.3)",
"sidebar": "oklch(0.145 0.000 89.9)",
"sidebarForeground": "oklch(0.779 0.000 89.9)",
"sidebarPrimary": "oklch(0.869 0.088 60.7)",
"sidebarPrimaryForeground": "oklch(0.173 0.000 89.9)",
"sidebarAccent": "oklch(0.226 0.000 89.9)",
"sidebarAccentForeground": "oklch(0.779 0.000 89.9)",
"sidebarBorder": "oklch(0.226 0.000 89.9)",
"sidebarRing": "oklch(0.869 0.088 60.7)"
}
}