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": "poimandres",
"label": "Poimandres",
"order": 8,
"description": "Muted dark palette with soft teal and lavender accents",
"codeTheme": {
"light": "coldarkCold",
"dark": "coldarkDark"
},
"shikiTheme": {
"light": "min-light",
"dark": "poimandres"
},
"light": {
"background": "oklch(0.980 0.005 286.3)",
"foreground": "oklch(0.324 0.023 274.8)",
"card": "oklch(0.950 0.005 286.3)",
"cardForeground": "oklch(0.324 0.023 274.8)",
"popover": "oklch(0.950 0.005 286.3)",
"popoverForeground": "oklch(0.324 0.023 274.8)",
"primary": "oklch(0.528 0.096 248.8)",
"primaryForeground": "oklch(0.980 0.005 286.3)",
"secondary": "oklch(0.899 0.008 286.2)",
"secondaryForeground": "oklch(0.324 0.023 274.8)",
"muted": "oklch(0.899 0.008 286.2)",
"mutedForeground": "oklch(0.593 0.051 276.7)",
"accent": "oklch(0.950 0.005 286.3)",
"accentForeground": "oklch(0.324 0.023 274.8)",
"destructive": "oklch(0.562 0.136 354.3)",
"border": "oklch(0.872 0.011 286.2)",
"input": "oklch(0.950 0.005 286.3)",
"ring": "oklch(0.528 0.096 248.8)",
"chart1": "oklch(0.528 0.096 248.8)",
"chart2": "oklch(0.646 0.103 186.6)",
"chart3": "oklch(0.562 0.136 354.3)",
"chart4": "oklch(0.593 0.051 276.7)",
"chart5": "oklch(0.761 0.155 88.2)",
"sidebar": "oklch(0.950 0.005 286.3)",
"sidebarForeground": "oklch(0.324 0.023 274.8)",
"sidebarPrimary": "oklch(0.528 0.096 248.8)",
"sidebarPrimaryForeground": "oklch(0.980 0.005 286.3)",
"sidebarAccent": "oklch(0.899 0.008 286.2)",
"sidebarAccentForeground": "oklch(0.324 0.023 274.8)",
"sidebarBorder": "oklch(0.872 0.011 286.2)",
"sidebarRing": "oklch(0.528 0.096 248.8)"
},
"dark": {
"background": "oklch(0.237 0.020 271.8)",
"foreground": "oklch(0.751 0.048 277.1)",
"card": "oklch(0.289 0.024 264.1)",
"cardForeground": "oklch(0.751 0.048 277.1)",
"popover": "oklch(0.289 0.024 264.1)",
"popoverForeground": "oklch(0.751 0.048 277.1)",
"primary": "oklch(0.863 0.071 247.4)",
"primaryForeground": "oklch(0.237 0.020 271.8)",
"secondary": "oklch(0.324 0.023 274.8)",
"secondaryForeground": "oklch(0.751 0.048 277.1)",
"muted": "oklch(0.324 0.023 274.8)",
"mutedForeground": "oklch(0.593 0.051 276.7)",
"accent": "oklch(0.289 0.024 264.1)",
"accentForeground": "oklch(0.949 0.020 245.6)",
"destructive": "oklch(0.654 0.146 349.8)",
"border": "oklch(0.324 0.023 274.8)",
"input": "oklch(0.289 0.024 264.1)",
"ring": "oklch(0.863 0.071 247.4)",
"chart1": "oklch(0.863 0.071 247.4)",
"chart2": "oklch(0.837 0.125 176.5)",
"chart3": "oklch(0.944 0.040 323.3)",
"chart4": "oklch(0.756 0.061 247.1)",
"chart5": "oklch(0.654 0.146 349.8)",
"sidebar": "oklch(0.216 0.018 275.0)",
"sidebarForeground": "oklch(0.751 0.048 277.1)",
"sidebarPrimary": "oklch(0.863 0.071 247.4)",
"sidebarPrimaryForeground": "oklch(0.237 0.020 271.8)",
"sidebarAccent": "oklch(0.289 0.024 264.1)",
"sidebarAccentForeground": "oklch(0.949 0.020 245.6)",
"sidebarBorder": "oklch(0.289 0.024 264.1)",
"sidebarRing": "oklch(0.863 0.071 247.4)"
}
}