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 ca44fa9515
5 changed files with 67 additions and 25 deletions

View File

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