From 6bce22685640a3032d1d3815e44b60e7552bfb82 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 15 May 2021 22:26:12 +0200 Subject: Use prefers-color-scheme media query --- assets/css/style.scss | 6 +++--- content/script.js | 5 ----- templates/base.html | 3 --- 3 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 content/script.js 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 @@ @include assign($breakpoint); } } -} -.t-light { - @include assign('light'); + @media (prefers-color-scheme: light) { + @include assign('light'); + } } 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 @@ -const lightTheme = localStorage.getItem("light"); - -if (lightTheme === "true") { - document.documentElement.classList.add("t-light"); -} 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 @@ - - - -- cgit v1.2.3-70-g09d2