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

feat: smart toggle bw system/light or system/dark, no flicker #264

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nrjdalal
Copy link
Contributor

@nrjdalal nrjdalal commented Feb 21, 2025

  • removed flicker from site logo
  • it's 2025, the mode toggle should be smart
    • if system theme is dark, initial render on visit/reload is system but dark logo, then on toggle switches to light logo, then toggles bw system/light logo
    • if system theme is light, initial render on visit/reload is system but light logo, then on toggle switches to dark logo, then toggles bw system/dark logo
  • in more simple terms, if system is dark -> toggles bw system/light, if system is light -> toggles bw system/dark
  • if the user doesn't deviate from system, if he switches bw light dark using system, the mode will switch too automatically
  • bonus, no flickers and smart initial render

see implementation at https://smart-toggle-originui.vercel.app

signed by Neeraj Dalal

Copy link

vercel bot commented Feb 21, 2025

@nrjdalal is attempting to deploy a commit to the Cruip Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant