diff options
Diffstat (limited to 'themes/hugo-pt2021')
-rw-r--r-- | themes/hugo-pt2021/assets/script.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/themes/hugo-pt2021/assets/script.js b/themes/hugo-pt2021/assets/script.js index f7b3973..57e5a39 100644 --- a/themes/hugo-pt2021/assets/script.js +++ b/themes/hugo-pt2021/assets/script.js @@ -58,6 +58,12 @@ const D = document, // use theme if set, otherwise fall back to browser preference // FIXME: move to DOMContentLoaded? +// +// update (2025-03-31): prefer dark mode by default and only set light +// mode if one of the following conditions is true: +// 1. the user has explicitly set the theme using the navbar button, or +// 2. the user has not explicitly set the theme but has indicated that +// they prefer light mode. C.add('dark'); // unconditionally set dark mode if (L && L.theme && L.theme === 'light') { C.remove('dark'); // set light theme |