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": "horizon",
"label": "Horizon",
"order": 10,
"description": "Warm sunset palette with rosy pink accents",
"codeTheme": {
"light": "duotoneLight",
"dark": "materialDark"
},
"shikiTheme": {
"light": "github-light",
"dark": "horizon"
},
"light": {
"background": "oklch(0.965 0.015 33.1)",
"foreground": "oklch(0.237 0.016 274.1)",
"card": "oklch(0.913 0.038 36.2)",
"cardForeground": "oklch(0.237 0.016 274.1)",
"popover": "oklch(0.913 0.038 36.2)",
"popoverForeground": "oklch(0.237 0.016 274.1)",
"primary": "oklch(0.567 0.222 18.8)",
"primaryForeground": "oklch(0.965 0.015 33.1)",
"secondary": "oklch(0.883 0.045 29.9)",
"secondaryForeground": "oklch(0.237 0.016 274.1)",
"muted": "oklch(0.883 0.045 29.9)",
"mutedForeground": "oklch(0.553 0.056 280.7)",
"accent": "oklch(0.913 0.038 36.2)",
"accentForeground": "oklch(0.237 0.016 274.1)",
"destructive": "oklch(0.567 0.222 18.8)",
"border": "oklch(0.837 0.060 32.6)",
"input": "oklch(0.913 0.038 36.2)",
"ring": "oklch(0.567 0.222 18.8)",
"chart1": "oklch(0.567 0.222 18.8)",
"chart2": "oklch(0.781 0.163 162.1)",
"chart3": "oklch(0.834 0.091 47.9)",
"chart4": "oklch(0.732 0.123 215.7)",
"chart5": "oklch(0.676 0.157 312.8)",
"sidebar": "oklch(0.913 0.038 36.2)",
"sidebarForeground": "oklch(0.237 0.016 274.1)",
"sidebarPrimary": "oklch(0.567 0.222 18.8)",
"sidebarPrimaryForeground": "oklch(0.965 0.015 33.1)",
"sidebarAccent": "oklch(0.883 0.045 29.9)",
"sidebarAccentForeground": "oklch(0.237 0.016 274.1)",
"sidebarBorder": "oklch(0.837 0.060 32.6)",
"sidebarRing": "oklch(0.567 0.222 18.8)"
},
"dark": {
"background": "oklch(0.237 0.016 274.1)",
"foreground": "oklch(0.880 0.004 236.5)",
"card": "oklch(0.267 0.021 276.8)",
"cardForeground": "oklch(0.880 0.004 236.5)",
"popover": "oklch(0.267 0.021 276.8)",
"popoverForeground": "oklch(0.880 0.004 236.5)",
"primary": "oklch(0.653 0.186 9.0)",
"primaryForeground": "oklch(0.965 0.015 33.1)",
"secondary": "oklch(0.313 0.025 278.5)",
"secondaryForeground": "oklch(0.880 0.004 236.5)",
"muted": "oklch(0.313 0.025 278.5)",
"mutedForeground": "oklch(0.553 0.056 280.7)",
"accent": "oklch(0.267 0.021 276.8)",
"accentForeground": "oklch(0.880 0.004 236.5)",
"destructive": "oklch(0.653 0.186 9.0)",
"border": "oklch(0.313 0.025 278.5)",
"input": "oklch(0.267 0.021 276.8)",
"ring": "oklch(0.653 0.186 9.0)",
"chart1": "oklch(0.653 0.186 9.0)",
"chart2": "oklch(0.781 0.163 162.1)",
"chart3": "oklch(0.834 0.091 47.9)",
"chart4": "oklch(0.732 0.123 215.7)",
"chart5": "oklch(0.676 0.157 312.8)",
"sidebar": "oklch(0.237 0.016 274.1)",
"sidebarForeground": "oklch(0.880 0.004 236.5)",
"sidebarPrimary": "oklch(0.653 0.186 9.0)",
"sidebarPrimaryForeground": "oklch(0.965 0.015 33.1)",
"sidebarAccent": "oklch(0.267 0.021 276.8)",
"sidebarAccentForeground": "oklch(0.880 0.004 236.5)",
"sidebarBorder": "oklch(0.267 0.021 276.8)",
"sidebarRing": "oklch(0.653 0.186 9.0)"
}
}