tnfshcec / tnfshcec-web

電機社社網
http://www.tnfshcec.com/
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

The theme switcher always shows dark mode on initial load #56

Closed Eggrror404 closed 1 week ago

Eggrror404 commented 7 months ago

image showing dark mode, while it's clearly light mode

Eggrror404 commented 7 months ago

seems like an issue with SvelteKit SSR and mode-watcher's undefined $mode on server

Eggrror404 commented 1 week ago

The issue is identified (way before this comment is made lol)

It's that Svelte thinks the two SVG's on either side of the if are the same, thus not updating the element when $mode changes.

It is however not fixable without a workaround - we'd just make them different, one is wrapped with <span>, one isn't.