next-themes
next-themes copied to clipboard
Next Themes Flash of White BG when using the basePath
Hi folks, thanks for all the awesome work here.
I'm using the latest next-themes
and next
but getting a flash of white bg when loading the page for the first time only.
On the homepage there's no flash, but I'm using basePath: '/docs'
if I go to localhost:3000/docs or even online in the live prod site, I see an issue only on the basePath URL — https://sourcegraph.com/docs — which makes me wonder if the basePath causes this issue. I have tried building and serving locally, same issue. Only happens on the basePath /docs and doesn't happen on localhost:300/
Help!
For some reason, the dark
class on HTML
is being removed and added again during page load. You can notice this more easily if you throttle the load through the Network Tab. Probably implementation issue
@PixeledCode I'm seeing the same weird behavior 😕
as am I
@MaedahBatool Did you manage to solve this issue? Page routing is not used anywhere in next-themes, so I doubt that it has anything to do with the setting. I would assume that the issue is that the loading of the script somehow is deferd.