mirror of
https://github.com/danbulant/Mangades
synced 2026-06-20 06:41:16 +00:00
make dark mode default
This commit is contained in:
parent
f40c4a4d65
commit
21daa3872f
1 changed files with 1 additions and 8 deletions
|
|
@ -16,7 +16,7 @@
|
|||
last = window.location.pathname;
|
||||
});
|
||||
|
||||
let defaultDarkmode = typeof window !== "undefined" && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
let defaultDarkmode = true; // typeof window !== "undefined" && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
typeof window !== "undefined" && window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
||||
if(defaultDarkmode == darkmode) {
|
||||
darkmode = event.matches;
|
||||
|
|
@ -34,9 +34,6 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<button class="darkmode-toggle" class:dark={darkmode} on:click={() => darkmode = !darkmode}>{darkmode ? "Light" : "Dark"}</button>
|
||||
|
||||
<!-- routify:options preload="proximity" -->
|
||||
<div class:dark={darkmode} class="main">
|
||||
<slot />
|
||||
</div>
|
||||
|
|
@ -69,10 +66,6 @@
|
|||
background: rgba(255,255,255,0.3);
|
||||
backdrop-filter: blur(25px);
|
||||
}
|
||||
.main {
|
||||
/* min-width: max(100%, 100vw);
|
||||
min-height: max(100%, 100vh); */
|
||||
}
|
||||
.dark {
|
||||
color: white;
|
||||
background: black;
|
||||
|
|
|
|||
Loading…
Reference in a new issue