Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme switching (light/dark) #84

Open
joeroe opened this issue Jul 8, 2024 · 2 comments
Open

Theme switching (light/dark) #84

joeroe opened this issue Jul 8, 2024 · 2 comments

Comments

@joeroe
Copy link
Owner

joeroe commented Jul 8, 2024

On a related note, how hard would it be to implement a theme-switching button for this template (aka light/dark mode)?

Originally posted by @BachoSeven in #50 (comment)

@joeroe joeroe changed the title On a related note, how hard would it be to implement a theme-switching button for this template (aka light/dark mode)? Theme switching (light/dark) Jul 8, 2024
@jrgn9
Copy link

jrgn9 commented Jul 17, 2024

I looked into how hard it would be to do myself and stumbled upon this: https://yonkov.github.io/post/add-dark-mode-toggle-to-hugo/

I haven't looked too closely on it. But it would be fantastic to be able to just set dark and light palette, and then get a switch for it.

@BachoSeven
Copy link

BachoSeven commented Aug 20, 2024

On my site, I ended up implementing it as in #50 (comment) but even simpler, still using the media query (without any button):

BachoSeven/bachoseven.github.io@aa597a2#diff-96dd75a968976edd5e03170268ed9085733f75c3fb24f992ae613c89e6de42dc

This uses an additional paletteLight variable in [params.theme] for configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants