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 dashboard - JavaScript HTML DOM, SCSS, Grid, Flexbox

Alex Li 400

@awexli

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


I'm still learning, so please let me know if there's ANYTHING I can improve on (code, code-structure, logic, best practices, etc)! I Love constructive feedback :-)

Community feedback

T
Matt Studdert 13,611

@mattstuddert

Posted

Awesome work on this challenge, Alex! Your solution looks really good and scales down beautifully to mobile. What was your reasoning for how you coded it all with JS?

My main recommendation is to avoid setting click listeners on non-interactive elements, like the div element for the toggle. These can't be accessed by anyone not using a mouse/trackpad to navigate the content, which is a bad practice. Instead, add click listeners to interactive elements like a or button. This will ensure the element is focusable and can be accessed by people not using a mouse/trackpad.

I hope you enjoyed this challenge. Keep up the great work!

0

Alex Li 400

@awexli

Posted

@mattstuddert Thanks for the feedback! I changed the div element to a and set its role to a button. I hope that's a better solution since I've always had such a hard time styling buttons.

As for why I coded it with JS, I just wanted to practice DOM manipulation haha

Thanks Matt, I'm having a lot of fun with Frontend Mentor!

0
T
Matt Studdert 13,611

@mattstuddert

Posted

@awexli haha, fair enough! It's a great way to learn more about DOM manipulation.

I'd recommend just using a button to be honest. If you ever find yourself setting the role of an element to another element that already exists that's normally the sign of a code smell. The main thing with styling button elements is that you normally need to just remove the border and set the font-family. Apart from that, it's pretty much the same as an anchor tag (except they're inline-block by default).

That's great to hear you're enjoying Frontend Mentor! 🥳

0
Alex Li 400

@awexli

Posted

@mattstuddert Ah I see! Thanks, I'll start applying that moving forward!

0
T
Matt Studdert 13,611

@mattstuddert

Posted

@awexli 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