summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-05-15 22:26:12 +0200
committerVolpeon <git@volpeon.ink>2021-05-15 22:26:12 +0200
commit6bce22685640a3032d1d3815e44b60e7552bfb82 (patch)
tree77e711a29a6793bd2e296ab4b64ac11b9b811177
parentSeparate script file (diff)
downloadvolpeon.ink-6bce22685640a3032d1d3815e44b60e7552bfb82.tar.gz
volpeon.ink-6bce22685640a3032d1d3815e44b60e7552bfb82.tar.bz2
volpeon.ink-6bce22685640a3032d1d3815e44b60e7552bfb82.zip
Use prefers-color-scheme media query
-rw-r--r--assets/css/style.scss6
-rw-r--r--content/script.js5
-rw-r--r--templates/base.html3
3 files changed, 3 insertions, 11 deletions
diff --git a/assets/css/style.scss b/assets/css/style.scss
index 3d9dde1..cd27f35 100644
--- a/assets/css/style.scss
+++ b/assets/css/style.scss
@@ -40,8 +40,8 @@
40 @include assign($breakpoint); 40 @include assign($breakpoint);
41 } 41 }
42 } 42 }
43}
44 43
45.t-light { 44 @media (prefers-color-scheme: light) {
46 @include assign('light'); 45 @include assign('light');
46 }
47} 47}
diff --git a/content/script.js b/content/script.js
deleted file mode 100644
index 649da9e..0000000
--- a/content/script.js
+++ /dev/null
@@ -1,5 +0,0 @@
1const lightTheme = localStorage.getItem("light");
2
3if (lightTheme === "true") {
4 document.documentElement.classList.add("t-light");
5}
diff --git a/templates/base.html b/templates/base.html
index 6006211..d9aaa8e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -28,11 +28,8 @@
28 <link rel="preload" href="/GaretVariable.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> 28 <link rel="preload" href="/GaretVariable.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
29 <link rel="preload" href="/iosevka-term-ss09-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> 29 <link rel="preload" href="/iosevka-term-ss09-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
30 <link rel="preload" href="/iosevka-term-ss09-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> 30 <link rel="preload" href="/iosevka-term-ss09-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
31 <link rel="preload" href="/script.js" as="script" />
32 31
33 <link rel="stylesheet" href="/style.css" /> 32 <link rel="stylesheet" href="/style.css" />
34
35 <script src="/script.js"></script>
36</head> 33</head>
37 34
38<body> 35<body>