ReactJS TailwindCSS Vite CSS Dropdown Menu Intro Website Challenge
Design comparison
Solution retrospective
I am very proud of the mobile responsive and desktop layouts. Additionally, my dropdown menus turned out great and are easy to use.
Next time, I would focus more on understanding the flexbox layout for the desktop navigation bar.
What challenges did you encounter, and how did you overcome them?-
Extension of TailwindCSS Config File: Throughout this project, my proficiency in utilizing TailwindCSS for custom styling significantly improved. I learned more about extending Tailwind's default theme to include project-specific colors, font sizes, and fonts. This was crucial for aligning the website's design with the predefined style guide. An example of this customization involved adding unique color schemes, adjusting font sizes for readability, and incorporating a custom font family, 'Epilogue', directly into Tailwind's configuration.
-
Extending Background Color with Tailwind CSS: To ensure the background color stretches to the bottom of the page, I applied the
min-h-screen
class to the mainin the App component. This approach guarantees that the
covers at least the full height of the viewport, allowing the background color to fill the entire visible area, independent of content height. -
Implementing Sidebar Navigation: Developing the sidebar navigation was a significant learning experience. I utilized React's
useState
to manage the sidebar's visibility, toggling between open and closed states upon interacting with the hamburger icon. For the mobile version, I positioned the hamburger icon at the top right, ensuring it animates in response to changes in width. -
Dropdown Menu for Mobile Layout: For the Features section, I crafted a dropdown menu, managing its visibility through state control and an
onClick
event handler. TailwindCSS styling was essential, ensuring the dropdown was both visually appealing and functional. -
Responsive Design with Media Queries: My understanding of media queries grew, particularly in making the navigation sidebar responsive. By assigning specific class names to the mobile layout and using media queries, I successfully hid the sidebar on desktop screens, applying similar strategies for mobile visibility.
-
**Understanding
Tags**: I discovered that
tags are void elements, meaning they cannot contain child elements and only accept attributes. This realization came while debugging an issue related to this constraint. -
Grid Layout with TailwindCSS: I implemented a two-part grid container using ReactJS for the desktop layout, positioning the image and text content effectively. This structure was pivotal in achieving a balanced and engaging layout.
-
Flexbox Fundamentals: My project experience enriched my understanding of flexbox, from basic flex properties to more complex configurations like
flex-row
andjustify-between
. These insights were invaluable in optimizing the layout and alignment of website elements. -
Enhancing Interactivity with Hover States: Adding hover states to buttons and text elements was my final task, where I leveraged TailwindCSS for animation and color transitions. This enhancement significantly improved the user interface, making interactive elements more engaging.
I would like help on how to use justify-between for the desktop navigation bar. I was able to get the navigation bar to look very good but wasn't able to get justify-between to work perfectly. Thanks!
Community feedback
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