Submitted almost 4 years agoA solution to the Social media dashboard with theme switcher challenge
Social Media Dashboard | SCSS & Vanilla JS with Local Storage
sass/scss
@krisp-dev

Solution retrospective
I have added a feature where your theme preference gets saved to the Local Storage where the theme stays dark upon page refresh. However, I couldn't quite get how to complete the following requirement of the challenge "Toggle color theme to their preference".
Wasn't sure whether to use a prefers-color-scheme media query on the variables decaled in body.dark or check for it in the JavaScript.
Would appreciate any insight or tips on how to check for the systems color scheme preference and apply it to my code.
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Kris Pietrzak's solution.
Join 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