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": "synthwave84",
"label": "SynthWave '84",
"order": 11,
"description": "Retro-futuristic neon palette with purple haze",
"codeTheme": {
"light": "prism",
"dark": "synthwave84"
},
"shikiTheme": {
"light": "min-light",
"dark": "synthwave-84"
},
"light": {
"background": "oklch(0.966 0.022 309.6)",
"foreground": "oklch(0.270 0.045 300.7)",
"card": "oklch(0.932 0.027 307.0)",
"cardForeground": "oklch(0.270 0.045 300.7)",
"popover": "oklch(0.932 0.027 307.0)",
"popoverForeground": "oklch(0.270 0.045 300.7)",
"primary": "oklch(0.560 0.183 333.8)",
"primaryForeground": "oklch(0.966 0.022 309.6)",
"secondary": "oklch(0.887 0.037 306.4)",
"secondaryForeground": "oklch(0.270 0.045 300.7)",
"muted": "oklch(0.887 0.037 306.4)",
"mutedForeground": "oklch(0.517 0.069 300.0)",
"accent": "oklch(0.932 0.027 307.0)",
"accentForeground": "oklch(0.270 0.045 300.7)",
"destructive": "oklch(0.555 0.206 18.8)",
"border": "oklch(0.851 0.040 304.9)",
"input": "oklch(0.932 0.027 307.0)",
"ring": "oklch(0.560 0.183 333.8)",
"chart1": "oklch(0.560 0.183 333.8)",
"chart2": "oklch(0.781 0.163 162.1)",
"chart3": "oklch(0.761 0.155 88.2)",
"chart4": "oklch(0.582 0.156 263.2)",
"chart5": "oklch(0.574 0.148 30.4)",
"sidebar": "oklch(0.932 0.027 307.0)",
"sidebarForeground": "oklch(0.270 0.045 300.7)",
"sidebarPrimary": "oklch(0.560 0.183 333.8)",
"sidebarPrimaryForeground": "oklch(0.966 0.022 309.6)",
"sidebarAccent": "oklch(0.887 0.037 306.4)",
"sidebarAccentForeground": "oklch(0.270 0.045 300.7)",
"sidebarBorder": "oklch(0.851 0.040 304.9)",
"sidebarRing": "oklch(0.560 0.183 333.8)"
},
"dark": {
"background": "oklch(0.268 0.033 291.6)",
"foreground": "oklch(0.792 0.000 89.9)",
"card": "oklch(0.270 0.045 300.7)",
"cardForeground": "oklch(0.792 0.000 89.9)",
"popover": "oklch(0.270 0.045 300.7)",
"popoverForeground": "oklch(0.792 0.000 89.9)",
"primary": "oklch(0.769 0.189 339.1)",
"primaryForeground": "oklch(0.268 0.033 291.6)",
"secondary": "oklch(0.313 0.067 295.6)",
"secondaryForeground": "oklch(0.792 0.000 89.9)",
"muted": "oklch(0.313 0.067 295.6)",
"mutedForeground": "oklch(0.650 0.075 277.9)",
"accent": "oklch(0.270 0.045 300.7)",
"accentForeground": "oklch(0.792 0.000 89.9)",
"destructive": "oklch(0.664 0.221 22.4)",
"border": "oklch(0.313 0.067 295.6)",
"input": "oklch(0.270 0.045 300.7)",
"ring": "oklch(0.769 0.189 339.1)",
"chart1": "oklch(0.769 0.189 339.1)",
"chart2": "oklch(0.892 0.144 193.2)",
"chart3": "oklch(0.904 0.150 95.3)",
"chart4": "oklch(0.697 0.152 302.3)",
"chart5": "oklch(0.731 0.153 27.2)",
"sidebar": "oklch(0.233 0.038 292.3)",
"sidebarForeground": "oklch(0.792 0.000 89.9)",
"sidebarPrimary": "oklch(0.769 0.189 339.1)",
"sidebarPrimaryForeground": "oklch(0.268 0.033 291.6)",
"sidebarAccent": "oklch(0.270 0.045 300.7)",
"sidebarAccentForeground": "oklch(0.792 0.000 89.9)",
"sidebarBorder": "oklch(0.270 0.045 300.7)",
"sidebarRing": "oklch(0.769 0.189 339.1)"
}
}