huddle-landing-page-with-single-introductory (React and tailwind)
Design comparison
Community feedback
- @tatasadiPosted 12 months ago
Very good job completing the Frontend Mentor challenge using React and Tailwind CSS! It's impressive to see your ability to work with these technologies. Here are a few suggestions to enhance your project:
Use Maximum Width for Main Content: Setting a maximum width for your main content area is crucial, especially for large screens. It ensures that your content doesn't stretch too much horizontally, which can harm readability and overall user experience. You can set a maximum width using Tailwind classes like
max-w-screen-lg
ormax-w-screen-xl
based on your design requirements.Simplifying Width Classes: Instead of using
w-[50%]
, Tailwind offers a more readable and concise class:w-1/2
. This class does exactly the same thing and improves the readability of your code. Tailwind's fractional width classes are very useful for quickly setting up responsive layouts.Refactoring Repeated Styles: For styles that are repeated across multiple elements, like your social icons, it's a good idea to define a custom class in your CSS file. This approach makes your code DRY (Don't Repeat Yourself) and easier to maintain. For example, in your CSS file:
.icon { @apply border-2 border-white border-solid rounded-full p-2 cursor-pointer hover:text-deeppink hover:border-deeppink; }
Then in your JSX, you can simply use
<span className="icon">...</span>
for each icon. This method is beneficial because:Maintainability: If you need to change the style of the icons, you only have to do it in one place.
Readability: It's easier to understand the purpose of a class named
icon
than deciphering a list of Tailwind classes each time.Scalability: As your project grows, having reusable classes will save you a lot of time and effort.
Keep up the excellent work! Your understanding of React and Tailwind CSS is evident, and implementing these suggestions will further polish your 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