
Solution retrospective
I'm most proud of how clean and responsive the accordion component turned out. I managed to keep the code organized and accessible while ensuring smooth toggle transitions and a mobile-first layout. It felt great to build a component that works well across different screen sizes with minimal bugs.
What I would do differently next time Next time, I’d focus more on accessibility from the beginning — for example, incorporating ARIA attributes and enabling full keyboard navigation. I’d also like to explore writing the logic using a framework like React to practice component-based architecture and state management.
What challenges did you encounter, and how did you overcome them?One of the main challenges was managing the toggle logic while keeping the layout from breaking when multiple answers were opened. Initially, I had trouble ensuring only one FAQ could be open at a time. I solved it by resetting all items before toggling the clicked one. It also took some trial and error to get the transitions smooth without breaking the layout, but using max-height and overflow tricks did the job.
I'd love feedback on improving accessibility — especially how to properly use ARIA roles and keyboard interactions for better user experience. I'm also open to suggestions on how to simplify or refactor the toggle logic to make the code more scalable and maintainable in larger projects.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Aleji0309'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