How to set a dark theme for the whole website? #220
-
I can only see dark setting for header / footer in the config.yaml, not the rest of the page. How can I set the dark model to TRUE by default? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
As a temporary fix, in document.documentElement.dataset.dark = window.localStorage.getItem("dark-mode") ?? true; I'll tweak this script in an upcoming update (#209) to allow setting a default more easily/cleanly, so look out for this change in the near future. |
Beta Was this translation helpful? Give feedback.
-
Hi, I noticed another bug after I change line 11 as you suggested above: It only works for the body part, not the footer/header. In details, I have the following line in the
and the following line in It looks all dark in the initial load, which seems great! However, when I click the toggle button at the footer, it only change the body part to white. The foot/header are still in dark. I expected the toggle button works for the whole page. Thanks |
Beta Was this translation helpful? Give feedback.
As a temporary fix, in
_scripts/dark-mode.js
, change line 11 to:I'll tweak this script in an upcoming update (#209) to allow setting a default more easily/cleanly, so look out for this change in the near future.