Replace all hardcoded #c8ff00 / rgba(200,255,0,...) with CSS custom properties (--accent, --accent-rgb) so the accent color updates live. Add themeStore (Zustand + localStorage) with 6 presets (Лайм, Синий, Розовый, Фиолет, Оранж, Минт). Add ThemeApplier component that syncs CSS vars on load. Add color picker UI section in ExtraTab. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
468 B
TypeScript
17 lines
468 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
import { useThemeStore, ACCENT_PRESETS } from '@/store/themeStore'
|
|
|
|
export default function ThemeApplier() {
|
|
const { accentIdx } = useThemeStore()
|
|
|
|
useEffect(() => {
|
|
const preset = ACCENT_PRESETS[accentIdx] ?? ACCENT_PRESETS[0]
|
|
document.documentElement.style.setProperty('--accent', preset.accent)
|
|
document.documentElement.style.setProperty('--accent-rgb', preset.rgb)
|
|
}, [accentIdx])
|
|
|
|
return null
|
|
}
|