From 4c1914e6919f995e63d19391be7c86c60dacbda6 Mon Sep 17 00:00:00 2001 From: Swissky <12152583+swisskyrepo@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:14:34 +0200 Subject: [PATCH] Dark mode JS --- _includes/dark-mode.html | 5 ++--- _layouts/default.html | 3 +-- _sass/_dark-mode-button.scss | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/_includes/dark-mode.html b/_includes/dark-mode.html index e61ec7d..b6670bd 100755 --- a/_includes/dark-mode.html +++ b/_includes/dark-mode.html @@ -5,11 +5,10 @@ function darkmode() { let enabled = localStorage.getItem('dark-mode') - if (enabled === null || enabled === 'true') { + if (enabled === null || enabled === 'true') { enable() } - - if (localStorage.getItem('dark-mode') === 'false') { + else if (localStorage.getItem('dark-mode') === 'false') { enable(); } else { disable(); diff --git a/_layouts/default.html b/_layouts/default.html index 8a54a45..019757e 100755 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -25,8 +25,7 @@

{{ site.name }}

-

{{ site.description }}

- 🌗 +

{{ site.description }}🌗