FAQ Accordion with React (useState) and Fluid CSS Clamp

Solution retrospective
I am most proud of implementing a truly fluid layout using the CSS clamp() function. It allowed me to handle responsiveness for font sizes and spacing without relying on multiple media queries. Next time, I would like to experiment with Framer Motion to add a smoother slide-down animation when opening the accordion items, as the current version uses a simple conditional rendering.
What challenges did you encounter, and how did you overcome them?One of the main challenges was handling the default browser styling for buttons, which initially messed up my alignment. I overcame this by using a CSS reset and carefully applying Flexbox. Another challenge was managing asset paths in Vite during the build process. I learned that while assets can be placed in the public folder for simple direct referencing, importing them as modules from the src/assets folder is the standard for larger projects to ensure proper bundling and optimization. For this project, I focused on ensuring the paths remained consistent between development and production.
What specific areas of your project would you like help with?I would appreciate feedback on my Accessibility (A11y) implementation. I used aria-expanded to communicate the state of the accordion, but I'd like to know if there are further improvements I could make for screen reader users, such as better focus management or using aria-controls.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Saliva-sys’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