This is a solution to the FAQ accordion card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the component depending on their device's screen size
- See hover states for all interactive elements on the page
- Hide/Show the answer to a question when the question is clicked
- Solution URL: https://github.com/Hugomndez/faq-accordion-card
- Live Site URL: https://faq-accordion-card-neon-omega.vercel.app
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- Next.js - React framework
- CSS Modules - For styles
// Element.scrollHeight
setHeight(contentEl.scrollHeight);
- Resource 1 - This helped me on creating the accordion feature. I really liked this pattern and will use it going forward.
- Resource 2 - The Element.scrollHeight read-only property is a measurement of the height of an element's content, including content not visible on the screen due to overflow.
- Website - Hugo Méndez
- Frontend Mentor - @Hugomndez