Skip to content

Light mode flash before the dark one #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MartinKavik opened this issue Dec 6, 2019 · 3 comments
Closed

Light mode flash before the dark one #7

MartinKavik opened this issue Dec 6, 2019 · 3 comments

Comments

@MartinKavik
Copy link
Member

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)

@MartinKavik
Copy link
Member Author

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?

@tiberiusferreira
Copy link

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.

@MartinKavik
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants