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 #8

Open
1 of 2 tasks
awaitlink opened this issue Sep 2, 2021 · 2 comments
Open
1 of 2 tasks

Dark mode #8

awaitlink opened this issue Sep 2, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@awaitlink
Copy link
Owner

awaitlink commented Sep 2, 2021

Implement a "dark" appearance:

  • Match the system appearance via the @media-query;
  • Maybe also add an option: system/light/dark.
@awaitlink awaitlink added the enhancement New feature or request label Sep 2, 2021
@Leptopoda
Copy link

Leptopoda commented Sep 2, 2021

Seems like you use tailwind,
I'm not familiar with it but doesn't it have a dark tag for auto dark mode based on media-query?

I might be wrong with that though

Edit:
Looking at the docs, you have to enable the module first 🙃. I'll have a look at it tomorrow.

@awaitlink
Copy link
Owner Author

awaitlink commented Sep 2, 2021

Looking at the docs, you have to enable the module first 🙃.

Indeed; though after enabling it in either media or class mode, the dark appearance itself generally has to be implemented manually:


However, in that issue I've also stumbled upon jjranalli/nightwind, which seems like it would do all the re-coloring automagically and seems to use the class mode. Maybe it would be easier to use it and then tweak colors in individual cases if needed (which it also supports). It also includes helper functions for switching the mode, which would probably need to be used like in yew's js_callback example (since the app uses Rust/WASM and the helper functions are in JavaScript).

Though the helper functions don't seem to support resetting the preference to "system" mode, which I think would be nice to have:

awaitlink added a commit that referenced this issue Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants