Expenses chart component

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 color
is not displaying. Other than that I did enjoy working on this project.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@markuslewin
It's because
.bg-cyan-700
is declared before.bg-softRed
in the generated CSS of Tailwind. It doesn't matter if you writeclassName="bg-softRed bg-cyan-700"
orclassName="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
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