Social media dashboard with theme switcher solution
Design comparison
Solution retrospective
I found it difficult making the light and dark toggle option. Tried out something and i hope it's actually good enough!
Community feedback
- @visualdennissPosted over 1 year ago
Hey,
Congrats on completing the challenge successfully!
Regarding the issue you mentioned: Currently it looks like the theme switch does not toggle when clicked on the circle itself, but only the inside of the checkbox. An alternative would be using
<button className="pricing-toggle"> <div className="pricing-toggle-circle"></div> </button>a HTML structure like this where the button and circle are nested and you can assign a toggle function to button onClick. This way it will also function when the circle itself is clicked. You can simultaneously toggle pricing-toggle-circle classes to move it inside the togge button. E.g. active circle would have left: 3px, while when not active it could have left: unset, right: 3px etc.
Hope this helps! Keep up the great work!
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