diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-18 00:26:02 -0300 |
---|---|---|
committer | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-18 00:26:02 -0300 |
commit | 9e782ba01620997becc3118433e3d1961a88b2c3 (patch) | |
tree | 14219adaa719d6c6fb913dd9a2cf73ba3a09df71 /static/js | |
parent | 17e54854794dacac8409cd10ffb77005d74b8dbe (diff) |
rudimentary theme switching
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/themes.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/static/js/themes.js b/static/js/themes.js index 0d9772f..19bdbb4 100644 --- a/static/js/themes.js +++ b/static/js/themes.js @@ -20,5 +20,11 @@ function setTheme(name) { } function applyTheme() { + // HACK: disable all of the themes first. this for some reason makes things work. + for (let i = 0, tags = document.getElementsByTagName("link"); i < tags.length; i++) { + if (tags[i].type === "text/css" && tags[i].title) { + tags[i].disabled = true; + } + } setTheme(getCookie("theme") || "default"); } |