Responsive dynamic chart component using React and Tailwind CSS

Solution retrospective
I'm getting used to Tailwind CSS with React, next time I will be able to create a visually appealing and responsive component more quickly.
What challenges did you encounter, and how did you overcome them?Implementing dynamic data rendering and conditional styling based on the data was the hardest part.
What specific areas of your project would you like help with?I need help with the chart's hover functionality. I haven't been able to ensure that the parent's hover effect of the chart bars does not affect the child's opacity (the div that shows daily expenses on hover). How did you do it?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @IvanFdez01
Hi, about your problem with hovers:
- You have something like:
<div bar> <div value></div> </div>
This makes that if you apply opacity to bar, then is also applied on value, as they are nested.
- Instead, you can do something like:
<div cont> <div bar></div> <div value></div> </div>
Where, in this case, cont would be the one who has
position:relative
and value would haceposition:absolute
(and special opacity etc). That would separate the styles for bar and value.Good job overall and by the way, what advantages can you obtain by modularizing as much as you have done? Maybe I don't know about frameworks and libraries yet, but is a genuine question as I'm always comfortable in my three .html, .css and .js files, but I see lots of modularized codes.
Cheers friend.
Marked as helpful - @sirjaey
Great job1
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