Files
CodePilot/themes/tokyo-night.json
T
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": "tokyo-night",
"label": "Tokyo Night",
"order": 3,
"description": "Neon-lit cityscape with deep blue undertones",
"codeTheme": {
"light": "materialLight",
"dark": "materialOceanic"
},
"shikiTheme": {
"light": "github-light",
"dark": "tokyo-night"
},
"light": {
"background": "oklch(0.929 0.008 278.6)",
"foreground": "oklch(0.360 0.053 273.4)",
"card": "oklch(0.895 0.010 273.3)",
"cardForeground": "oklch(0.360 0.053 273.4)",
"popover": "oklch(0.895 0.010 273.3)",
"popoverForeground": "oklch(0.360 0.053 273.4)",
"primary": "oklch(0.476 0.140 260.2)",
"primaryForeground": "oklch(1.000 0.000 89.9)",
"secondary": "oklch(0.883 0.010 273.3)",
"secondaryForeground": "oklch(0.358 0.031 269.6)",
"muted": "oklch(0.883 0.010 273.3)",
"mutedForeground": "oklch(0.555 0.022 279.2)",
"accent": "oklch(0.914 0.008 278.6)",
"accentForeground": "oklch(0.358 0.031 269.6)",
"destructive": "oklch(0.480 0.100 9.5)",
"border": "oklch(0.815 0.007 277.1)",
"input": "oklch(0.883 0.010 273.3)",
"ring": "oklch(0.476 0.140 260.2)",
"chart1": "oklch(0.476 0.140 260.2)",
"chart2": "oklch(0.700 0.040 275.4)",
"chart3": "oklch(0.580 0.110 165.0)",
"chart4": "oklch(0.550 0.120 310.0)",
"chart5": "oklch(0.600 0.130 20.0)",
"sidebar": "oklch(0.883 0.010 273.3)",
"sidebarForeground": "oklch(0.358 0.031 269.6)",
"sidebarPrimary": "oklch(0.476 0.140 260.2)",
"sidebarPrimaryForeground": "oklch(1.000 0.000 89.9)",
"sidebarAccent": "oklch(0.914 0.008 278.6)",
"sidebarAccentForeground": "oklch(0.358 0.031 269.6)",
"sidebarBorder": "oklch(0.815 0.007 277.1)",
"sidebarRing": "oklch(0.476 0.140 260.2)"
},
"dark": {
"background": "oklch(0.226 0.021 280.5)",
"foreground": "oklch(0.767 0.054 275.5)",
"card": "oklch(0.261 0.034 274.2)",
"cardForeground": "oklch(0.767 0.054 275.5)",
"popover": "oklch(0.261 0.034 274.2)",
"popoverForeground": "oklch(0.767 0.054 275.5)",
"primary": "oklch(0.719 0.132 264.2)",
"primaryForeground": "oklch(0.226 0.021 280.5)",
"secondary": "oklch(0.282 0.036 274.7)",
"secondaryForeground": "oklch(0.846 0.061 274.8)",
"muted": "oklch(0.306 0.037 273.2)",
"mutedForeground": "oklch(0.496 0.068 274.4)",
"accent": "oklch(0.259 0.025 274.4)",
"accentForeground": "oklch(0.846 0.061 274.8)",
"destructive": "oklch(0.723 0.159 10.3)",
"border": "oklch(0.266 0.028 281.3)",
"input": "oklch(0.240 0.031 275.6)",
"ring": "oklch(0.719 0.132 264.2)",
"chart1": "oklch(0.719 0.132 264.2)",
"chart2": "oklch(0.700 0.120 85.0)",
"chart3": "oklch(0.630 0.120 165.0)",
"chart4": "oklch(0.650 0.120 310.0)",
"chart5": "oklch(0.723 0.159 10.3)",
"sidebar": "oklch(0.204 0.016 284.9)",
"sidebarForeground": "oklch(0.767 0.054 275.5)",
"sidebarPrimary": "oklch(0.719 0.132 264.2)",
"sidebarPrimaryForeground": "oklch(0.226 0.021 280.5)",
"sidebarAccent": "oklch(0.259 0.025 274.4)",
"sidebarAccentForeground": "oklch(0.846 0.061 274.8)",
"sidebarBorder": "oklch(0.175 0.008 285.5)",
"sidebarRing": "oklch(0.719 0.132 264.2)"
}
}