(isDark: boolean)
| 15 | } |
| 16 | |
| 17 | function applyTheme(isDark: boolean): void { |
| 18 | const roots = SCOPE_ROOT_IDS.map((id) => document.getElementById(id)).filter((el): el is HTMLElement => !!el); |
| 19 | if (roots.length === 0) { |
| 20 | applyThemeToElement(document.documentElement, isDark); |
| 21 | return; |
| 22 | } |
| 23 | for (const root of roots) applyThemeToElement(root, isDark); |
| 24 | } |
| 25 | |
| 26 | export function useThemeSync(): void { |
| 27 | const themeMode = useSettingStore((s) => s.themeMode); |
no test coverage detected