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

Expenses chart component

#react#tailwind-css

@Mike-Dave

Desktop design screenshot for the Expenses chart component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I have successfully completed this challenge and I am open to receiving any feedback or corrections. After deployment, I don't know why the cyan coloris not displaying. Other than that I did enjoy working on this project.

Community feedback

P
markus 1,430

@markuslewin

Posted

It's because .bg-cyan-700 is declared before .bg-softRed in the generated CSS of Tailwind. It doesn't matter if you write className="bg-softRed bg-cyan-700" or className="bg-cyan-700 bg-softRed", the red will always override the cyan.

You could instead write:

<div className={`${items.day === "wed" ? "bg-cyan-700" : "bg-softRed"}`} />

That way, the logic applies either cyan or red!

Marked as helpful

0

@Mike-Dave

Posted

@markuslewin Thank you for the feedback. I agree with what you wrote and will be implementing it as well.

1

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