From 5aab2b5254c7a38dbba90fc498ed58d028854614 Mon Sep 17 00:00:00 2001 From: Rise <8315221+AmazingRise@users.noreply.github.com> Date: Sat, 11 Apr 2020 17:59:03 +0800 Subject: Updated Dark Mode (markdown) --- Dark-Mode.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dark-Mode.md b/Dark-Mode.md index 37a93f0..da1fe35 100644 --- a/Dark-Mode.md +++ b/Dark-Mode.md @@ -6,4 +6,18 @@ If you don't like this feature, you can disable it. Add `disableDarkMode=true` to the section of `[param]` in your `config.toml`. 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) + +```javascript + if (night==""){ + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + //this.toggleDarkMode(); + } +``` + +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