Design comparison
Community feedback
- @tatasadiPosted 11 months ago
Hey there,
Good job on implementing this challenge! It's great to see your use of React components to build interactive elements. Here are some suggestions to further refine your work:
Tailwind CSS Color Names: In your Tailwind configuration, it's a best practice to keep your color names all lowercase. Instead of naming your colors like
"Light-Pink"
,"Dark-Purple"
, and so on, you should use lowercase names such as"light-pink"
,"dark-purple"
. Here's why:- Consistency: Tailwind itself uses lowercase for utility classes. Keeping your custom configurations consistent with Tailwind's naming conventions makes your code easier to read and maintain.
- Avoid Errors: CSS class names are case-sensitive. Using a consistent casing reduces the risk of typos and errors, especially in a team environment where different members might recall the casing differently.
Adjust your tailwind.config.js accordingly:
colors: { "light-pink": "#F8EEFF", "dark-purple": "#301534", "pale-purple": "#8B6990", "pink": "#AD28EB", },
Removing the Border from the Last Accordion: You should remove the bottom border from the last accordion item. Assuming all your Accordion components are direct children of a container, you can do the following:
-
Ensure that the parent container of the Accordion components has a flex or grid display, or any other configuration that makes the last: pseudo-class applicable.
-
Apply the last:border-b-0 utility class to the Accordion component directly, assuming each one has a bottom border applied that you wish to remove for the last item.
className="border-b-[0.0625rem] border-light-pink p-4 last:border-b-0"
These adjustments will enhance the maintainability of your code and align your implementation more closely with best practices and design requirements. Keep up the great work, and continue refining your skills with each project!
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin 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