(el: HTMLElement, isDark: boolean)
| 7 | const SCOPE_ROOT_IDS = ["paper-debugger-root", "pd-portal", "pd-embed-sidebar"]; |
| 8 | |
| 9 | function applyThemeToElement(el: HTMLElement, isDark: boolean): void { |
| 10 | if (isDark) { |
| 11 | el.classList.add("dark"); |
| 12 | } else { |
| 13 | el.classList.remove("dark"); |
| 14 | } |
| 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); |