Design comparison
Solution retrospective
The theme switcher when browser is refreshed should remain the same until it is clicked
Community feedback
- @jonathancklee1Posted 7 months ago
Hi Alli,
Great work in completing this project. If you want to keep the dark mode set when user refreshes the browser, is to store this dark mode variable in the local storage. When a page is refreshed, the page is rerun and all states are refreshed to the original declaration, so the browser won't know the page state before. Every time the dark mode button is clicked, you can push the state to local storage and also grab it from there when the page loads.
Hope this helps!
Marked as helpful0@oma16Posted 7 months ago@jonathancklee1 Thanks for the response, it was helpful
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord