Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/AmazingRise/hugo-theme-diary.wiki.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dark-Mode.md14
1 files changed, 14 insertions, 0 deletions
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