mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-02-21 12:58:26 -06:00
18 lines
388 B
JavaScript
18 lines
388 B
JavaScript
export function initThemeHelper() {
|
|
function getTheme() {
|
|
const theme = localStorage.getItem("theme");
|
|
return theme || "";
|
|
}
|
|
|
|
function setTheme(theme) {
|
|
localStorage.setItem("theme", theme);
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
}
|
|
|
|
window.getTheme = getTheme;
|
|
window.setTheme = setTheme;
|
|
|
|
const theme = getTheme();
|
|
setTheme(theme);
|
|
}
|