Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Social Media Tracker Using Sass and Vanilla JS

@shubhamthedev

Desktop design screenshot for the Social media dashboard with theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi, it's been a long time since i was here but i've been utilizing this time to learn JS from scratch. So this is the very first project in which i have used JS extensively.I focused more on writing JS rather than the UI and would love hearing feedback on my Javascript code. Plus if anybody knows how the folders should be structured then please let me know in the comments.

Community feedback

P
Matt Studdert 13,611

@mattstuddert

Posted

Hey Shubham, nice to see you post a new solution. Where have you been learning JS? Your code looks fine, but I'd say you've over-engineered the solution in this instance. You don't need so much JS code to switch between a light and a dark theme. You can simply use it to toggle a class or HTML attribute and then use CSS custom properties to take care of the color changes.

Here's a great article that runs through this approach: https://hankchizljaw.com/wrote/create-a-user-controlled-dark-or-light-mode/

I hope this helps!

1

@shubhamthedev

Posted

@mattstuddert Yeah i know it's a mess but i went through others solution afterwards and found some insights into how it should be done and thanks for the link i'll go through this.

0
P
Matt Studdert 13,611

@mattstuddert

Posted

@tomboynotes no problem!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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