summaryrefslogtreecommitdiff
path: root/assets/js/theme.js
blob: ffb6d48412d980a55a9e36eea17f0d7f2e3fb3b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict"
const THEME_KEY = "used-theme";

function updateTheme() {
    let theme = localStorage.getItem(THEME_KEY);
    if (theme != null) {
        document.documentElement.setAttribute(THEME_KEY, theme)
    }
}

function setTheme(theme) {
    localStorage.setItem(THEME_KEY, theme);
    updateTheme();
}

updateTheme();