chore: cleanup theme stuff

This commit is contained in:
Adam
2025-12-28 10:14:30 -06:00
parent 82a876da4d
commit f89b83a6d7
4 changed files with 10 additions and 106 deletions

View File

@@ -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
*/