mirror of
https://github.com/turboderp-org/exui.git
synced 2026-03-15 00:07:27 +00:00
22 lines
449 B
JavaScript
22 lines
449 B
JavaScript
|
|
const themes = {
|
|
Dark: "theme-dark",
|
|
Darker: "theme-darker",
|
|
Darkblue: "theme-darkblue",
|
|
Light: "theme-light",
|
|
Bold: "theme-bold",
|
|
}
|
|
|
|
export function getThemesList() {
|
|
return Object.keys(themes);
|
|
}
|
|
|
|
export function setTheme(theme) {
|
|
const root = document.documentElement;
|
|
|
|
for (let t of getThemesList()) {
|
|
if (t == theme) root.classList.add(themes[t]);
|
|
else root.classList.remove(themes[t]);
|
|
}
|
|
}
|