When switching between (for example) Blog anchor and Home anchor in dark mode in my website, all the transitions are "executed" just after document.documentElement.dataset.theme = "dark"
if localHost.theme == "dark"
runs when the any page loads. That happens here.
This is not a desired behavior, but I cannot find a good way to make this behavior appear.
The site is built with Astro but that shouldn't be a problem.
It can be tested here. However, this problem only occurs in production, so you will have to npm run build
and npm run preview
right after.
Thank you very much in advance.