Add theme toggle back and default to 'auto'

This commit is contained in:
Dave Gallant
2024-01-12 16:55:10 -05:00
parent 24ad44a9ec
commit b913e9b4a3
5 changed files with 69 additions and 22 deletions

View File

@@ -7,8 +7,9 @@
<script>
// load comments
var getTheme =
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: light)").matches
(localStorage && localStorage.getItem("theme")) ||
(window.matchMedia &&
window.matchMedia("(prefers-color-scheme: light)").matches)
? "light"
: "dark";
getTheme = getTheme == null ? "dark" : getTheme;