tailwindlabs / tailwindui-issues

Bug fixes and feature request tracking for Tailwind UI.
233 stars 4 forks source link

Continuous disturbing color mode switching on Catalyst UI previewe site #1579

Closed matagaralph closed 3 months ago

matagaralph commented 3 months ago

What component (if applicable)

Describe the bug When switching to dark mode and then back to light mode, the page starts flickering or continuously changing between the color modes in a disturbing manner. I can also confirm this behavior on my mobile phone. Please investigate this issue.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://catalyst.tailwindui.com Catalyst UI preview site
  2. Click on color mode switcher couple of times trying to switch between themes and watch the behavior of the pages.
  3. The page will start flickering or continuously changing the color modes. Expected behavior Switching from dark to light or vice versa should work perfectly without a disturbing continuous transitions or flickerings.

Browser/Device (if applicable)

adamwathan commented 3 months ago

Thanks for reporting, narrowed this down to just happening on pages that have a demo in an iframe and I think what's happening is the docs themselves and the demo are fighting with each other when the theme switch happens, triggering some sort of infinite loop. Going to replace those embedded demos with screenshots for now until we can figure it out!

adamwathan commented 3 months ago

Alright fixed by replacing the embedded demos with images for now 👍 Going to close this one, thanks for reporting!

matagaralph commented 3 months ago

I can confirm that the temporary fix worked. Thanks for addressing it. I no longer need to reload the pages.