Skip to content

Automatic dark/light mode toggle, force dark mode #453

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

Merged
merged 5 commits into from
Oct 21, 2021

Conversation

ColinFrick
Copy link
Contributor

This adds a new event listener to the color scheme, and always as a third option for enableDarkMode

Any objection against the option value always? It could also be force or something like that?
What do you think?

Closes #369

@ColinFrick ColinFrick marked this pull request as ready for review October 18, 2021 15:26
@curquiza curquiza requested a review from bidoubiwa October 18, 2021 18:39
@bidoubiwa
Copy link
Contributor

Could you update your branch with main? Cypress CI tests are not triggered automatically

@ColinFrick
Copy link
Contributor Author

Could you update your branch with main? Cypress CI tests are not triggered automatically

Done

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of auto instead of always ?

@ColinFrick
Copy link
Contributor Author

Wouldn't auto suggest automatically changing between dark / light mode? That would currently be true.

@bidoubiwa
Copy link
Contributor

I think auto implies that it will either go for light or dark based on the user's preferences. false implies that it will always be light and true that it will always be dark. At least this is how I see it. Thus always means that it will be always dark.

The naming of enableDarkMode may not be the best. Until we find a better naming I think auto is more suitable.

@ColinFrick
Copy link
Contributor Author

That would be a breaking change right? Until now true meant set dark/light mode to system mode.

@bidoubiwa
Copy link
Contributor

That would be a breaking change right? Until now true meant set dark/light mode to system mode.

Oke indeed you are right! I misunderstood the PR.

So just to be sure, the difference between the modes as for now is:

  • false: always light mode
  • true: system mode (light or dark)
  • auto: Always dark mode?

@ColinFrick
Copy link
Contributor Author

I changed the PR according to your suggestion:

  • false: always light mode
  • true: always dark mode
  • auto: system mode (light or dark)

@bidoubiwa
Copy link
Contributor

That seems like the best option! I will review the code ASAP :) Probably not today

@ColinFrick
Copy link
Contributor Author

@bidoubiwa thank you for the input. I have changed it accordingly.

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥 Thanks for this PR. This was very very needed 🎉

For the 200'th time 😂 If you are participating in Hacktoberfest, and you would like to receive a small gift from MeiliSearch too, please complete this form.

Thanka so much for you involvement and you great PR's

@bidoubiwa
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 21, 2021

@bors bors bot merged commit 9864000 into meilisearch:main Oct 21, 2021
@ColinFrick ColinFrick deleted the feat/369 branch October 21, 2021 10:03
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

Successfully merging this pull request may close these issues.

Automatic dark/light mode toggle
2 participants