Expense Chart Component (Chart-js + Tailwindcss)

Solution retrospective
This is my first time using chart-js
Please log in to post a comment
Log in with GitHubCommunity feedback
- @0xabdulkhaliq
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have a suggestion regarding your code that I believe will be of great interest to you.
TAILWIND CLASSES 📐:
- Your solution is well designed and matches the actual design image provided by FEM, Congrats for that. I'm here to address a small suggestion on
min-h-[100vh]
utility class.
- You want
min-height: 100vh
right ? Then you need to usemin-h-screen
class instead ofmin-h-[100vh]
.
- We don't need to create arbitrary tailwind utility class, because there's already a class for that.
- Additionally, I want to mention the usage of
h1
in your solution. It's not a good practice to useh1
for display balance.
- An
h1
heading provides an mportant navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
- So just replace the
h1
withp
orspan
, I would prefer to usespan
by nesting it's content withp
and just style it like you need.
- Example:
<p class="text-sm"> My balance <span class="font-[600] text-2xl block">$921.48</span> </p>
- Now you want to add a level-one heading to improve accessibility, Don't worry you can add a visually hidden Heading adding a
sr-only
class to hide it from visual users (it will be useful for visually impaired users)
- Example:
<h1 class="sr-only">Expenses chart component</h1>
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful - @KorneyChervonenko
Hello friend, There is a requirement in readme: “current day's bar highlighted in a different colour to the other bars”. How do you think “current day” is a some random day of week or it must be changed dynamically when page is loaded in browser? In other words “current day” is today ?
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