diff options
| author | Adam <[email protected]> | 2025-12-28 10:14:30 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-28 10:14:30 -0600 |
| commit | f89b83a6d797568b1240c0c141db526e170c0299 (patch) | |
| tree | c3ec863a4e71dff085ed3e335e50e492ef14d56c /packages/ui/src/theme/context.tsx | |
| parent | 82a876da4de0074ca3d4d6af9a31dc6e8cf20c3a (diff) | |
| download | opencode-f89b83a6d797568b1240c0c141db526e170c0299.tar.gz opencode-f89b83a6d797568b1240c0c141db526e170c0299.zip | |
chore: cleanup theme stuff
Diffstat (limited to 'packages/ui/src/theme/context.tsx')
| -rw-r--r-- | packages/ui/src/theme/context.tsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/ui/src/theme/context.tsx b/packages/ui/src/theme/context.tsx index 9a2013ee9..e2c31477c 100644 --- a/packages/ui/src/theme/context.tsx +++ b/packages/ui/src/theme/context.tsx @@ -19,7 +19,6 @@ import { } from "solid-js" import type { DesktopTheme } from "./types" import { resolveThemeVariant, themeToCss } from "./resolve" -import { STORAGE_KEYS, getThemeCacheKey } from "./preload" import { DEFAULT_THEMES } from "./default-themes" export type ColorScheme = "light" | "dark" | "system" @@ -43,6 +42,16 @@ interface ThemeContextValue { const ThemeContext = createContext<ThemeContextValue>() +const STORAGE_KEYS = { + THEME_ID: "opencode-theme-id", + COLOR_SCHEME: "opencode-color-scheme", + THEME_CSS_PREFIX: "opencode-theme-css", +} as const + +function getThemeCacheKey(themeId: string, mode: "light" | "dark"): string { + return `${STORAGE_KEYS.THEME_CSS_PREFIX}-${themeId}-${mode}` +} + /** * Static tokens that don't change between themes */ |
