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": "night-owl",
"label": "Night Owl",
"order": 7,
"description": "Deep navy palette for night-time coding",
"codeTheme": {
"light": "coy",
"dark": "nightOwl"
},
"shikiTheme": {
"light": "night-owl-light",
"dark": "night-owl"
},
"light": {
"background": "oklch(0.988 0.000 89.9)",
"foreground": "oklch(0.377 0.034 286.9)",
"card": "oklch(0.955 0.000 89.9)",
"cardForeground": "oklch(0.377 0.034 286.9)",
"popover": "oklch(0.955 0.000 89.9)",
"popoverForeground": "oklch(0.377 0.034 286.9)",
"primary": "oklch(0.582 0.156 263.2)",
"primaryForeground": "oklch(0.988 0.000 89.9)",
"secondary": "oklch(0.907 0.000 89.9)",
"secondaryForeground": "oklch(0.377 0.034 286.9)",
"muted": "oklch(0.907 0.000 89.9)",
"mutedForeground": "oklch(0.714 0.030 228.3)",
"accent": "oklch(0.955 0.000 89.9)",
"accentForeground": "oklch(0.377 0.034 286.9)",
"destructive": "oklch(0.601 0.198 26.1)",
"border": "oklch(0.885 0.000 89.9)",
"input": "oklch(0.955 0.000 89.9)",
"ring": "oklch(0.582 0.156 263.2)",
"chart1": "oklch(0.582 0.156 263.2)",
"chart2": "oklch(0.646 0.103 186.6)",
"chart3": "oklch(0.761 0.155 88.2)",
"chart4": "oklch(0.564 0.186 311.7)",
"chart5": "oklch(0.577 0.135 22.2)",
"sidebar": "oklch(0.955 0.000 89.9)",
"sidebarForeground": "oklch(0.377 0.034 286.9)",
"sidebarPrimary": "oklch(0.582 0.156 263.2)",
"sidebarPrimaryForeground": "oklch(0.988 0.000 89.9)",
"sidebarAccent": "oklch(0.907 0.000 89.9)",
"sidebarAccentForeground": "oklch(0.377 0.034 286.9)",
"sidebarBorder": "oklch(0.885 0.000 89.9)",
"sidebarRing": "oklch(0.582 0.156 263.2)"
},
"dark": {
"background": "oklch(0.193 0.045 244.0)",
"foreground": "oklch(0.898 0.020 260.2)",
"card": "oklch(0.273 0.058 247.3)",
"cardForeground": "oklch(0.898 0.020 260.2)",
"popover": "oklch(0.273 0.058 247.3)",
"popoverForeground": "oklch(0.898 0.020 260.2)",
"primary": "oklch(0.744 0.131 264.3)",
"primaryForeground": "oklch(0.193 0.045 244.0)",
"secondary": "oklch(0.341 0.056 244.6)",
"secondaryForeground": "oklch(0.898 0.020 260.2)",
"muted": "oklch(0.341 0.056 244.6)",
"mutedForeground": "oklch(0.553 0.024 196.5)",
"accent": "oklch(0.273 0.058 247.3)",
"accentForeground": "oklch(0.898 0.020 260.2)",
"destructive": "oklch(0.654 0.193 25.1)",
"border": "oklch(0.287 0.051 244.4)",
"input": "oklch(0.273 0.058 247.3)",
"ring": "oklch(0.744 0.131 264.3)",
"chart1": "oklch(0.744 0.131 264.3)",
"chart2": "oklch(0.780 0.204 150.7)",
"chart3": "oklch(0.834 0.153 127.4)",
"chart4": "oklch(0.743 0.135 311.1)",
"chart5": "oklch(0.749 0.138 37.5)",
"sidebar": "oklch(0.193 0.045 244.0)",
"sidebarForeground": "oklch(0.898 0.020 260.2)",
"sidebarPrimary": "oklch(0.744 0.131 264.3)",
"sidebarPrimaryForeground": "oklch(0.193 0.045 244.0)",
"sidebarAccent": "oklch(0.273 0.058 247.3)",
"sidebarAccentForeground": "oklch(0.898 0.020 260.2)",
"sidebarBorder": "oklch(0.273 0.058 247.3)",
"sidebarRing": "oklch(0.744 0.131 264.3)"
}
}