MCPcopy Create free account
hub / github.com/anomalyco/opencode / ensureLoaderStyleElement

Function ensureLoaderStyleElement

packages/ui/src/theme/loader.ts:8–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const THEME_STYLE_ID = "opencode-theme"
7
8function ensureLoaderStyleElement(): HTMLStyleElement {
9 const existing = document.getElementById(THEME_STYLE_ID) as HTMLStyleElement | null
10 if (existing) {
11 return existing
12 }
13 const element = document.createElement("style")
14 element.id = THEME_STYLE_ID
15 document.head.appendChild(element)
16 return element
17}
18
19export function applyTheme(theme: DesktopTheme, themeId?: string): void {
20 activeTheme = theme

Callers 1

applyThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected