What is the recommended way to replace the default dark/light theme menu? #36
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I'd recommend creating the layouts/partials/hb/modules/header-theme-toggle/index.html on your site root to modify the UI, you'll need to pay attention on the HTML class name and attributes, so that it can trigger the related JS functionalities. Other modules rely on the custom events emitted by this module, such as the Mermaid module will change it's theme when light/dark mode changing, so I won't recommend creating a new module which may lost those functionalities. |
Beta Was this translation helpful? Give feedback.
-
BTW, PR are welcome if you want to share your implementation.
Please create an option for switching different UI, such as Reference: |
Beta Was this translation helpful? Give feedback.
-
This turns out to be lot more complicated than I thought it would be. I have no experience with GoLang, so new here. Below are my learnings for others, feel free to correct me if I'm wrong.
My love for Hugo and HBS and HBStack is turning painful, signing off for the day. |
Beta Was this translation helpful? Give feedback.
-
Yep, it's complicated if you're not familar Hugo development.
That's a problem I didn't think about it.
This project use SVG icons instead of CSS/CDN, all available icons can be found on https://icons.hugomods.com/.
Sadly to hear that, I can track this as a feature request. |
Beta Was this translation helpful? Give feedback.
-
Done, implement since |
Beta Was this translation helpful? Give feedback.
Done, implement since
github.com/hbstack/header/modules/[email protected]
, but with a single button.