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

Dark mode #71

Open
pachacamac opened this issue May 11, 2021 · 2 comments
Open

Dark mode #71

pachacamac opened this issue May 11, 2021 · 2 comments

Comments

@pachacamac
Copy link

What would be the most idiomatic way to add a dark mode switch in Bonsai? It's easy to add a dark-mode class, overwrite some variables from src/variables.css and toggle it on body with e.g. a checkbox. However that approach does not allow for css transitions. Any hints?

@pachacamac
Copy link
Author

anything? :)

@opencoca
Copy link

Building out a sites darkmode variables is the cleanest option.

@media (prefers-color-scheme:dark) {
    :root {...

See prefers-color-schem (https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)

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

2 participants