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

Automatic dark mode #2591

Closed
martinbonnin opened this issue Jul 28, 2022 · 3 comments · Fixed by #2611
Closed

Automatic dark mode #2591

martinbonnin opened this issue Jul 28, 2022 · 3 comments · Fixed by #2611
Labels
enhancement An issue for a feature or an overall improvement good first issue A beginner-friendly issue for which some assistance is expected

Comments

@martinbonnin
Copy link
Contributor

Follow up from #1731

The dark mode is nice 👏 . Would be nice to have an "automatic mode" that detects the current OS setting. This seems to be possible. See this stackoverflow question for a possible implementation.

The dark mode would be a 3 way setting:

  • light
  • dark
  • auto
@martinbonnin martinbonnin added the enhancement An issue for a feature or an overall improvement label Jul 28, 2022
@IgnatBeresnev IgnatBeresnev added the good first issue A beginner-friendly issue for which some assistance is expected label Jul 28, 2022
@IgnatBeresnev
Copy link
Member

This would be nice to have!

If anyone wishes to contribute, I believe the code for enabling dark mode is here.

Would be nice to have an "automatic mode" that detects the current OS setting

Not sure how to add a 3rd auto option, there's a single toggle button atm. Would you expect the button to have 3 states or would you rather see it in the configuration settings?

I think if you open up Dokka for the first time, it could choose light/dark mode based on OS theme, and then if the person decides to switch it to something else - remember that choice.

@martinbonnin
Copy link
Contributor Author

Not sure how to add a 3rd auto option, there's a single toggle button atm. Would you expect the button to have 3 states or would you rather see it in the configuration settings?

Not sure TBH. Apple documentations have a 3-state "chooser":

Screenshot 2022-07-28 at 13 51 36

Looks like Android documentation is light mode only. Our own docs do what you suggest below.

I think if you open up Dokka for the first time, it could choose light/dark mode based on OS theme, and then if the person decides to switch it to something else - remember that choice.

Makes sense, probably the easiest way to implement it and would work in the vast majority of use cases 👍

@pt2121
Copy link
Contributor

pt2121 commented Aug 7, 2022

First time contributing here, I put in a PR which should do what you mentioned:

I think if you open up Dokka for the first time, it could choose light/dark mode based on OS theme, and then if the person decides to switch it to something else - remember that choice.

Please let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement good first issue A beginner-friendly issue for which some assistance is expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants