Responsive expenses chart component using React and TailwindCSS

Solution retrospective
I learned how to write custom Tailwind classes. I had values for padding, colors, font size, font weight, and border radius that differed from TailwindCSS' default styling. I extended TailwindCSS' styles in tailwind.config.js.
What challenges did you encounter, and how did you overcome them?theme: { extend: { ... colors: { 'soft-red': '#EC755D', } ... } }
While figuring out how to dynamically set the height of each bar chart, I used string interpolation to generate an arbitrary TailwindCSS class for the height. After a few tests, the bar charts weren't visible.
I googled this issue and discovered that TailwindCSS doesn't recognize dynamically generated classes using props with React or Vue. I decided to use inline styles to set the height.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Semaj Primm's solution.
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