Submitted 2 months ago
Four Card Feature Section with Next.js TypeScript, TailwindCSS
@MarcWebDev
Design comparison
SolutionDesign
Community feedback
- @tatasadiPosted about 2 months ago
Good job on the implementation, it looks solid overall! Here are a few suggestions to improve the code:
- Instead of using fixed widths like
w-[540px]
for your paragraphs or cards, use responsive widths likemax-w-[540px]
orw-full
with padding. This will make the layout more fluid on various screen sizes. - Avoid using hardcoded values like
w-[350px]
andh-[250px]
for the card containers. Consider usingflex-grow
,flex-shrink
, or relative sizing units (like percentages orvw/vh
) to make the design responsive and flexible. - For the mobile view, you could simplify the use of custom media queries like
max-[580px]
. Consider using Tailwind's built-in breakpoints (sm:
,md:
, etc.) for consistency and cleaner code. - Be mindful of the repetition in card component styling. You could extract the common card structure into a separate component and pass props to keep the code DRY (Don't Repeat Yourself). This will make future maintenance easier.
Keep up the great work!
Marked as helpful1 - Instead of using fixed widths like
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