(themeKey)
| 40 | } |
| 41 | |
| 42 | export function setTheme(themeKey) { |
| 43 | if (themeKey in THEME) { |
| 44 | currentThemeKey = themeKey; |
| 45 | themeSaver.set(themeKey); |
| 46 | cssTag.href = `themes/${themeKey}.less`; |
| 47 | |
| 48 | // remove old compiled css |
| 49 | document.querySelector("style[id^=less]")?.remove?.(); |
| 50 | |
| 51 | // compile new css |
| 52 | less?.refresh?.(); |
| 53 | } else { |
| 54 | alert("WRONG THEME KEY " + themeKey); |
| 55 | } |
| 56 | } |
no test coverage detected