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

Add support for toggling color mode ('night/day mode') #382

Merged
merged 11 commits into from
Jan 30, 2023

Conversation

thavocado
Copy link
Contributor

@thavocado thavocado commented Jan 29, 2023

Add support for toggling color mode ('night/day mode')

This pull request adds support for toggling Chakra's color modes, including the dark mode.

It is easy to use, using the pc.toggle_color_mode() helper:

pc.button(
   pc.icon(tag="MoonIcon"),
   on_click=pc.toggle_color_mode(),
)

No custom styling is necessary to use the dark mode, it is built-into Chakra.

Your night/dat mode preference is stored locally as per the Chakra docs.

I believe this pull request would enhance Pynecone's appeal. Having a dark mode on your site is quickly becoming standard and is desired by many users.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes locally?

@Alek99
Copy link
Contributor

Alek99 commented Jan 29, 2023

Nice going to test this locally and then review

@Alek99 Alek99 self-requested a review January 29, 2023 18:44
Copy link
Contributor

@Alek99 Alek99 left a comment

Choose a reason for hiding this comment

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

Very nice just tested and works well!

@Alek99 Alek99 merged commit 41fffe6 into reflex-dev:main Jan 30, 2023
ACucos1 pushed a commit to ACucos1/rd-pynecone that referenced this pull request Feb 28, 2023
Co-authored-by: g0ee <0@g0.ee>
Co-authored-by: g0ee <adbokat.b.a.s.e@gmail.com>
@jakobschlosser97
Copy link

is it possible to change the default colors of the dark/light mode?

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.

None yet

4 participants