(theme: DesktopTheme, themeId?: string)
| 17 | } |
| 18 | |
| 19 | export function applyTheme(theme: DesktopTheme, themeId?: string): void { |
| 20 | activeTheme = theme |
| 21 | const lightTokens = resolveThemeVariant(theme.light, false) |
| 22 | const darkTokens = resolveThemeVariant(theme.dark, true) |
| 23 | const lightV2Tokens = resolveThemeVariantV2(theme.light, false) |
| 24 | const darkV2Tokens = resolveThemeVariantV2(theme.dark, true) |
| 25 | const targetThemeId = themeId ?? theme.id |
| 26 | const css = buildThemeCss(lightTokens, darkTokens, lightV2Tokens, darkV2Tokens, targetThemeId) |
| 27 | const themeStyleElement = ensureLoaderStyleElement() |
| 28 | themeStyleElement.textContent = css |
| 29 | document.documentElement.setAttribute("data-theme", targetThemeId) |
| 30 | } |
| 31 | |
| 32 | function buildThemeCss( |
| 33 | light: ResolvedTheme, |
nothing calls this directly
no test coverage detected