Files
opencode-manager/frontend/src/hooks/useTheme.ts
T
Chris Scott 5bd688de4b feat(themes): apply OpenCode color themes app-wide with a settings picker (#364)
- Vendor the 36 OpenCode theme palettes into the shared package, synced
  from the pinned OpenCode release tag via pnpm themes:sync.
- Add a colorTheme user preference across the settings schema, defaults,
  and the assistant internal API.
- Extend palettes with success, warning, info, and diff colors, and add a
  resolver that maps palettes to CSS tokens and applies them to the DOM.
- Apply the theme app-wide through a ThemeProvider context, adopting the
  tokens in message, repo, session, and settings components, agent
  colors, git status styles, and diff viewers.
- Add a theme picker to General settings and make model quick-select
  follow the active theme (fixes #355).
2026-09-28 00:19:32 -04:00

8 lines
251 B
TypeScript

import { useThemeMode } from '@/contexts/ThemeContext'
import { getDocumentThemeMode } from '@/lib/theme/colorTheme'
export function useTheme(): 'light' | 'dark' {
const contextMode = useThemeMode()
return contextMode ?? getDocumentThemeMode()
}