Skip to content

Conversation

@kronpatel
Copy link

Dear @suryanshsingh2001

Fixes #20

Changes made

This PR implements smooth theme transitions and prevents double-toggle issues by:

  • Adding isChanging state in theme-toggle.tsx to prevent rapid clicks
  • Adding CSS transitions for smooth color changes (300ms)
  • Improving icon animation with framer-motion

Testing done

✅ Theme changes animate smoothly (300ms transition)
✅ No flash effect when switching themes
✅ Rapid clicks don't cause glitches
✅ No hydration warnings on page load
✅ Icon animates smoothly with rotation

How to verify

  1. npm run dev and open http://localhost:3000
  2. Click theme toggle - colors should transition smoothly
  3. Click rapidly - should handle clicks properly without glitches
  4. Refresh page - should load correct theme without warnings

If you find this PR suitable for merging, I would be grateful if you could kindly add the hacktoberfest-accepted label to this PR (or the associated issue). This will ensure that my contribution is counted for Hacktoberfest and will greatly support my participation in the event.

Thank you very much for your time and consideration

@vercel
Copy link

vercel bot commented Oct 24, 2025

@kronpatel is attempting to deploy a commit to the Suryansh Singh's projects 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.

[Enhancement] Smooth theme toggle — prevent flash and double-toggle

1 participant