diff --git a/src/app.html b/src/app.html index f55c078..9a166b7 100644 --- a/src/app.html +++ b/src/app.html @@ -8,7 +8,7 @@ %sveltekit.head% - +
%sveltekit.body%
diff --git a/src/lib/stores/darkmode.js b/src/lib/stores/darkmode.js index 3d64e43..6474834 100644 --- a/src/lib/stores/darkmode.js +++ b/src/lib/stores/darkmode.js @@ -4,10 +4,11 @@ import { writable } from "svelte/store"; // it works! But isn't very performant - darkmode is switched after loading the page, not very friendly // could probably set a cookie and have the class be set in SSR as well, I don't really want to spend the time on that now. // TODO: make this use cookies and SSR -const darkmode = writable( - typeof window === "undefined" ? false : - (JSON.parse(localStorage.getItem("darkmode")) || window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) -); +// const darkmode = writable( +// typeof window === "undefined" ? false : +// (JSON.parse(localStorage.getItem("darkmode")) || window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) +// ); +const darkmode = writable(true) darkmode.subscribe(v => { if(typeof window !== "undefined")