Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 4 years ago

Social Media KPI page with switching CSS for dark mode

Richard Convery•20
@richardconvery
A solution to the Social media dashboard with theme switcher challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hey guys!

This is my first every Frontend Mentor challange and my first use of JavaScript within a page (just been learning JS on Codecademy up until now).

In this challenge I used JS to switch between two different CSS files. It was nice and easy for this project, however if this was a production situation then I'd look for a different solution as it'd be difficult to keep two separate css files in sync.

Any feedback on how to do that differently is more than welcome!

Richard

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Samuel Palacios•615
    @samuelpalaciosdev
    Posted over 4 years ago

    Hi, Richard👋

    Great job on this challenge. Your solution looks good and it scales pretty well👍

    I only suggest some things 😉:

    • Knows when to use paragraphs insteads ofheadings h1-h6. Headings provide valuable information by highlighting important topics and the structure of the document, you should know when to use and when not an heading tag. I'd not set the "followers" as an heading instead as a paragraph.

    • About the dark mode question. I suggest you to watch this video.

    I hope this would help you, have a nice day, keep coding!💙

  • Davide•1,705
    @Da-vi-de
    Posted over 4 years ago

    Hi Richard, great result for this changellenge. I did this project too, if you are interested you can take a look at my solution. [I did some research and i saw this video(https://www.youtube.com/watch?v=ZKXv_ZHQ654)], it helped me a lot.

    In my repo there's a comment in scss file: _base.scss where i explain what i did to make things work.

    I just want to suggest you two things:

    1. Try to separate and comment code in html, it's easier to read for others.
    2. Learning sass is very beneficial, code is cleaner and organized.

    For any questions feel free to ask. Happy coding :-)

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub