Theme Switcher Social Dashboard was made with HTML5,CSS3 and JS
Design comparison
Solution retrospective
When you switch the theme for the first time, the page load without the css for a moment. I think that is because the local Storage, but i don't know. If someone knows why this is happening, pls talk to me.
Community feedback
- @rfilenkoPosted over 4 years ago
Hello, good job, but you can improve it. The problem is with your js solution of changing light/dark theme. You are injecting diff css which causes overflow. Proper way of doing the toggle - create one .css file (or sass with few imports). There define default, light theme colors (you can use custom properties) and also .dark-mode class( for appllying darkmode changes). With js just toggle this class, for example on body.
Also noticed css issies:
- overflow problem, disable width: 100vw on body and after pseudo el.
- don't use just vw units for font-size - on bigger screens 1vw will be too small.
Cheers, Roman
0@EdimarioJrPosted over 4 years ago@rfilenko Thanks for the tips, man. I did a little research and find a better way to implement the theme switch thing,
using css variables and classes, like you told.
I disabled the width: 100vw and readapted my fonts.
Cheers, Edimário.
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