turnstone/web/uno.config.ts
pyr0ball de621175d0 feat: dark/light theme — CSS variables, OS preference, toggle button
- theme.css: CSS custom properties for both modes (surface, accent, text,
  sev, badge); .dark class override; smooth 0.15s transitions
- uno.config.ts: colors now reference var() — all semantic classes
  auto-switch with the .dark class; dark: 'class' strategy enabled
- main.ts: apply saved preference (localStorage ts-theme) or
  prefers-color-scheme before first paint to prevent flash
- App.vue: ☾/☀ toggle button persists choice to localStorage
- IncidentsView: severityStyle() uses badge CSS variables via inline
  style — fixes /opacity modifier incompatibility with CSS vars
2026-05-09 16:20:07 -07:00

34 lines
947 B
TypeScript

import { defineConfig, presetAttributify, presetWind } from 'unocss'
export default defineConfig({
presets: [presetWind(), presetAttributify()],
dark: 'class',
theme: {
colors: {
surface: {
DEFAULT: 'var(--color-surface)',
raised: 'var(--color-surface-raised)',
border: 'var(--color-surface-border)',
},
accent: {
DEFAULT: 'var(--color-accent)',
muted: 'var(--color-accent-muted)',
},
sev: {
debug: 'var(--color-sev-debug)',
info: 'var(--color-sev-info)',
warn: 'var(--color-sev-warn)',
error: 'var(--color-sev-error)',
critical: 'var(--color-sev-critical)',
},
text: {
primary: 'var(--color-text-primary)',
muted: 'var(--color-text-muted)',
dim: 'var(--color-text-dim)',
},
},
fontFamily: {
mono: ['JetBrains Mono', 'monospace'],
},
},
})