Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 11 months ago

ReactJS TailwindCSS Vite CSS Dropdown Menu Intro Website Challenge

react, tailwind-css, vite
lavollmer•410
@lavollmer
A solution to the Intro section with dropdown navigation challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

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?
  1. 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.

  2. 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 main in 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.

  3. 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.

  4. 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.

  5. 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.

  6. **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.

  7. 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.

  8. Flexbox Fundamentals: My project experience enriched my understanding of flexbox, from basic flex properties to more complex configurations like flex-row and justify-between. These insights were invaluable in optimizing the layout and alignment of website elements.

  9. 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.

What specific areas of your project would you like help with?

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!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on lavollmer's solution.

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.