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": "kanagawa",
"label": "Kanagawa",
"order": 6,
"description": "Ink-wash palette with warm parchment tones",
"codeTheme": {
"light": "vs",
"dark": "duotoneEarth"
},
"shikiTheme": {
"light": "kanagawa-lotus",
"dark": "kanagawa-wave"
},
"light": {
"background": "oklch(0.936 0.063 101.6)",
"foreground": "oklch(0.452 0.026 285.3)",
"card": "oklch(0.887 0.077 98.0)",
"cardForeground": "oklch(0.452 0.026 285.3)",
"popover": "oklch(0.887 0.077 98.0)",
"popoverForeground": "oklch(0.452 0.026 285.3)",
"primary": "oklch(0.521 0.086 261.5)",
"primaryForeground": "oklch(0.958 0.057 101.0)",
"secondary": "oklch(0.868 0.055 99.4)",
"secondaryForeground": "oklch(0.452 0.026 285.3)",
"muted": "oklch(0.868 0.055 99.4)",
"mutedForeground": "oklch(0.628 0.013 101.6)",
"accent": "oklch(0.887 0.077 98.0)",
"accentForeground": "oklch(0.452 0.026 285.3)",
"destructive": "oklch(0.571 0.171 16.5)",
"border": "oklch(0.831 0.083 96.4)",
"input": "oklch(0.887 0.077 98.0)",
"ring": "oklch(0.521 0.086 261.5)",
"chart1": "oklch(0.521 0.086 261.5)",
"chart2": "oklch(0.748 0.112 128.4)",
"chart3": "oklch(0.833 0.090 81.6)",
"chart4": "oklch(0.638 0.087 301.7)",
"chart5": "oklch(0.571 0.171 16.5)",
"sidebar": "oklch(0.958 0.057 101.0)",
"sidebarForeground": "oklch(0.452 0.026 285.3)",
"sidebarPrimary": "oklch(0.521 0.086 261.5)",
"sidebarPrimaryForeground": "oklch(0.958 0.057 101.0)",
"sidebarAccent": "oklch(0.887 0.077 98.0)",
"sidebarAccentForeground": "oklch(0.452 0.026 285.3)",
"sidebarBorder": "oklch(0.831 0.083 96.4)",
"sidebarRing": "oklch(0.521 0.086 261.5)"
},
"dark": {
"background": "oklch(0.243 0.017 285.1)",
"foreground": "oklch(0.876 0.039 99.1)",
"card": "oklch(0.291 0.024 284.8)",
"cardForeground": "oklch(0.876 0.039 99.1)",
"popover": "oklch(0.291 0.024 284.8)",
"popoverForeground": "oklch(0.876 0.039 99.1)",
"primary": "oklch(0.694 0.095 263.7)",
"primaryForeground": "oklch(0.243 0.017 285.1)",
"secondary": "oklch(0.340 0.028 284.8)",
"secondaryForeground": "oklch(0.876 0.039 99.1)",
"muted": "oklch(0.340 0.028 284.8)",
"mutedForeground": "oklch(0.547 0.012 101.0)",
"accent": "oklch(0.291 0.024 284.8)",
"accentForeground": "oklch(0.876 0.039 99.1)",
"destructive": "oklch(0.559 0.167 23.1)",
"border": "oklch(0.340 0.028 284.8)",
"input": "oklch(0.291 0.024 284.8)",
"ring": "oklch(0.694 0.095 263.7)",
"chart1": "oklch(0.694 0.095 263.7)",
"chart2": "oklch(0.748 0.112 128.4)",
"chart3": "oklch(0.833 0.090 81.6)",
"chart4": "oklch(0.638 0.087 301.7)",
"chart5": "oklch(0.693 0.197 22.1)",
"sidebar": "oklch(0.243 0.017 285.1)",
"sidebarForeground": "oklch(0.876 0.039 99.1)",
"sidebarPrimary": "oklch(0.694 0.095 263.7)",
"sidebarPrimaryForeground": "oklch(0.243 0.017 285.1)",
"sidebarAccent": "oklch(0.291 0.024 284.8)",
"sidebarAccentForeground": "oklch(0.876 0.039 99.1)",
"sidebarBorder": "oklch(0.291 0.024 284.8)",
"sidebarRing": "oklch(0.694 0.095 263.7)"
}
}