SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
587 stars 43 forks source link

[BUG]: Theme toggle flickering #175

Closed The-CodeINN closed 1 month ago

The-CodeINN commented 2 months ago

Description 📝

When attempting to toggle the theme, the interface experiences rapid flickering, reverting back to the original theme almost immediately.

Though it is commented out in the code

Link 🔗

No response

Screenshots 📸

image

The-CodeINN commented 2 months ago

I am currently investigating what could be the problem

Ansub commented 2 months ago

yeah that's why i commented it out because it was not working and dark mode is not a priority atm.

But if you want to debug it, feel free to do so, as it will definitely help in the future as Dark Mode is in the roadmap

theaniketnegi commented 1 month ago

Can I work on this?

Ansub commented 1 month ago

Can I work on this?

sure

theaniketnegi commented 1 month ago

Can I work on this?

sure

I did end up finding (and probably fixing) what could be causing the theme flickering, but I'm not sure as it seems intentional, because the dark mode hasn't been implemented yet.

Ansub commented 1 month ago

where was the issue, can you lmk the file name?

theaniketnegi commented 1 month ago

where was the issue, can you lmk the file name?

It seems to be present in in the ThemeWatcher component in app/providers.tsx

The specific code snippet: if (resolvedTheme === systemTheme) { setTheme('light') }

which seems to force the light theme whenever there's an attempt to change the theme.

Ansub commented 1 month ago

that makes sense

theaniketnegi commented 1 month ago

I guess I should just let it be then.