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

Function ensureThemeStyleElement

packages/ui/src/theme/context.tsx:119–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117}
118
119function ensureThemeStyleElement(): HTMLStyleElement {
120 const existing = document.getElementById(THEME_STYLE_ID) as HTMLStyleElement | null
121 if (existing) return existing
122 const element = document.createElement("style")
123 element.id = THEME_STYLE_ID
124 document.head.appendChild(element)
125 return element
126}
127
128function getSystemMode(): "light" | "dark" {
129 if (typeof window !== "object") return "light"

Callers 1

applyThemeCssFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected