diff options
author | Rise <8315221+AmazingRise@users.noreply.github.com> | 2020-05-20 19:04:33 +0300 |
---|---|---|
committer | Rise <8315221+AmazingRise@users.noreply.github.com> | 2020-05-20 19:04:33 +0300 |
commit | 1638873dcc94de63a639b75e583d22d295f09c2d (patch) | |
tree | 2cb4c597d31334015383ce8397e23909e9be0032 | |
parent | 05b042acec44279cfef7eeb9c7ff4ac62f992391 (diff) |
Updated Dark Mode (markdown)
-rw-r--r-- | Dark-Mode.md | 11 |
1 files 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 |