UNPKG

346 BJavaScriptView Raw
1const Theme = {
2 LIGHT: 'light',
3 DARK: 'dark'
4};
5
6function applyTheme(params) {
7 if (!params || !params.element || !params.currentTheme) {
8 return;
9 }
10
11 if (params.prevTheme) {
12 params.element.classList.remove(params.prevTheme);
13 }
14
15 params.element.classList.add(params.currentTheme);
16}
17
18
19export {applyTheme};
20export default Theme;