()
| 6 | const THEME_STYLE_ID = "opencode-theme" |
| 7 | |
| 8 | function 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 | |
| 19 | export function applyTheme(theme: DesktopTheme, themeId?: string): void { |
| 20 | activeTheme = theme |