From 1638873dcc94de63a639b75e583d22d295f09c2d Mon Sep 17 00:00:00 2001 From: Rise <8315221+AmazingRise@users.noreply.github.com> Date: Thu, 21 May 2020 00:04:33 +0800 Subject: Updated Dark Mode (markdown) --- Dark-Mode.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Dark-Mode.md b/Dark-Mode.md index da1fe35..0a86221 100644 --- a/Dark-Mode.md +++ b/Dark-Mode.md @@ -8,16 +8,9 @@ Then you will not see it. ## Automatically enable Dark Mode -Open `/static/js/journey.js`, and you will find this snippet. -(Currently at Line 78) +Add `enableAutoDarkMode=true` to the section of `[param]` in your `config.toml`. -```javascript - if (night==""){ - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { - //this.toggleDarkMode(); - } -``` +(Thanks for the advice of james-cccc. [Issue #40](https://github.com/AmazingRise/hugo-theme-diary/issues/40)) -And remove `//` from `this.toggleDarkMode();`, then your site will enter dark mode automatically, following browser's preference. Feel free to raise an issue if you have some questions. :) \ No newline at end of file -- cgit v1.2.3