Files
CodePilot/themes/nord.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": "nord",
"label": "Nord",
"order": 5,
"description": "Arctic, north-bluish color palette from the Polar Night",
"codeTheme": {
"light": "coldarkCold",
"dark": "nord"
},
"shikiTheme": {
"light": "github-light",
"dark": "nord"
},
"light": {
"background": "oklch(0.951 0.007 260.7)",
"foreground": "oklch(0.324 0.023 264.2)",
"card": "oklch(0.933 0.010 261.8)",
"cardForeground": "oklch(0.324 0.023 264.2)",
"popover": "oklch(0.933 0.010 261.8)",
"popoverForeground": "oklch(0.324 0.023 264.2)",
"primary": "oklch(0.594 0.077 254.0)",
"primaryForeground": "oklch(0.951 0.007 260.7)",
"secondary": "oklch(0.899 0.016 262.7)",
"secondaryForeground": "oklch(0.324 0.023 264.2)",
"muted": "oklch(0.899 0.016 262.7)",
"mutedForeground": "oklch(0.452 0.035 264.1)",
"accent": "oklch(0.899 0.016 262.7)",
"accentForeground": "oklch(0.324 0.023 264.2)",
"destructive": "oklch(0.606 0.121 15.3)",
"border": "oklch(0.899 0.016 262.7)",
"input": "oklch(0.933 0.010 261.8)",
"ring": "oklch(0.594 0.077 254.0)",
"chart1": "oklch(0.594 0.077 254.0)",
"chart2": "oklch(0.775 0.062 217.5)",
"chart3": "oklch(0.606 0.121 15.3)",
"chart4": "oklch(0.730 0.070 90.0)",
"chart5": "oklch(0.650 0.100 170.0)",
"sidebar": "oklch(0.933 0.010 261.8)",
"sidebarForeground": "oklch(0.324 0.023 264.2)",
"sidebarPrimary": "oklch(0.594 0.077 254.0)",
"sidebarPrimaryForeground": "oklch(0.951 0.007 260.7)",
"sidebarAccent": "oklch(0.899 0.016 262.7)",
"sidebarAccentForeground": "oklch(0.324 0.023 264.2)",
"sidebarBorder": "oklch(0.899 0.016 262.7)",
"sidebarRing": "oklch(0.594 0.077 254.0)"
},
"dark": {
"background": "oklch(0.324 0.023 264.2)",
"foreground": "oklch(0.899 0.016 262.7)",
"card": "oklch(0.379 0.029 266.5)",
"cardForeground": "oklch(0.899 0.016 262.7)",
"popover": "oklch(0.379 0.029 266.5)",
"popoverForeground": "oklch(0.899 0.016 262.7)",
"primary": "oklch(0.775 0.062 217.5)",
"primaryForeground": "oklch(0.324 0.023 264.2)",
"secondary": "oklch(0.416 0.032 264.1)",
"secondaryForeground": "oklch(0.899 0.016 262.7)",
"muted": "oklch(0.416 0.032 264.1)",
"mutedForeground": "oklch(0.697 0.059 248.7)",
"accent": "oklch(0.416 0.032 264.1)",
"accentForeground": "oklch(0.899 0.016 262.7)",
"destructive": "oklch(0.606 0.121 15.3)",
"border": "oklch(0.379 0.029 266.5)",
"input": "oklch(0.379 0.029 266.5)",
"ring": "oklch(0.775 0.062 217.5)",
"chart1": "oklch(0.775 0.062 217.5)",
"chart2": "oklch(0.697 0.059 248.7)",
"chart3": "oklch(0.606 0.121 15.3)",
"chart4": "oklch(0.770 0.070 90.0)",
"chart5": "oklch(0.700 0.100 170.0)",
"sidebar": "oklch(0.324 0.023 264.2)",
"sidebarForeground": "oklch(0.899 0.016 262.7)",
"sidebarPrimary": "oklch(0.775 0.062 217.5)",
"sidebarPrimaryForeground": "oklch(0.324 0.023 264.2)",
"sidebarAccent": "oklch(0.416 0.032 264.1)",
"sidebarAccentForeground": "oklch(0.899 0.016 262.7)",
"sidebarBorder": "oklch(0.379 0.029 266.5)",
"sidebarRing": "oklch(0.775 0.062 217.5)"
}
}