mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-08 01:22:29 +00:00
Add theme toggle back and default to 'auto'
This commit is contained in:
@@ -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";
|
||||
|
Reference in New Issue
Block a user