seed-rs / seed-rs.org

Seed's official website

Home Page:https://seed-rs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Light mode flash before the dark one

MartinKavik opened this issue · comments

The website is really good! Thanks!
The only small problem is that if you switch to dark mode and refresh the page, it first renders in light mode, then switches.

Originally posted by @tiberiusferreira in seed-rs/seed#303 (comment)

Default light mode is prerendered. So it changes once the wasm is loaded and Seed choose the right mode according to the local storage value.

One solution can be to move switching logic from Rust to JS and inline it into HTML. What do you think?

This is a good idea and does solve the problem, but since it is such a small problem I'd prefer to keep the code in Rust which makes it easier for newcomers to follow what's going on, even if that means the flashing keeps happening.

I agree. Closing, we can reopen it once we find a Rust-only solution.