Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

FAQ accordion card ft. 11ty, CUBE CSS, PostCSS, and Vanilla JS

accessibility, cube-css, eleventy, nunjucks
Josh Javier•950
@joshjavier
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


For this challenge, I used the same tooling as my previous solution so I was able to put more attention on refining my workflow.

Initially, I considered using the details and summary elements to implement the accordions, since they are natively interactive. However, there are some issues and inconsistencies on how browsers and assistive tech implement these features, so I decided to implement an alternative yet common accessible accordion pattern instead.

I used vanilla JS to make the accordions interactive, but the accordions will be expanded if JavaScript does not load or if the user disables it, so they can still consume the content.

I tried to practice a little bit of axiomatic CSS, a concept advocated by Heydon Pickering. Lovely stuff.

Finally, I think I spent too much time figuring out how to place the floating box just outside the left edge of the card. But it gave me a much deeper understanding of how some CSS properties work, specifically overflow: hidden and position: absolute.

Let me know if you have any feedback!

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Josh Javier'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

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