hanwenguo / hugo-theme-nostyleplease

a (nearly) no-CSS, fast, minimalist Hugo theme ported from riggraz/no-style-please.
MIT License
218 stars 81 forks source link

[Help]: Button to toggle dark mode #7

Open fockboi-lgtm opened 1 year ago

fockboi-lgtm commented 1 year ago

Hello,

I was wondering if there's any way to add this feature of adding a button to toggle dark mode/light mode. I understand that this might not be in the interest of everyone, but I would appreciate any pointers on how to do the same.

Thanks

hanwenguo commented 1 year ago

Hello, Sorry for being late to reply. This feature might not be added since after some consideration I didn't figure out where the best place is to put the toggle button at and how the button should look like. Nevertheless, this feature is not hard to implement. Just add a button to toggle the a attribute of <body> between empty light and dark. Wish this would help.