Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

FAQ accordion (Tailwind CSS)

accessibility, animation, pwa, tailwind-css, lighthouse
Melvin Aguilar 🧑🏻‍💻•61,020
@MelvinAguilar
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi there 👋, I’m Melvin, and this is my solution for this challenge. 🚀

🎁 Features:

  • Achieved 100% in Lighthouse score for performance, accessibility, best practices, and SEO. 📊
  • Progressive Web App (PWA) support. 📱🌐
  • Utilized TailwindCSS for responsive styling. 🎨
  • Codebase is well-maintained and formatted using Prettier. 💻
  • Resemblance with the original design. 🎨
  • No media queries were used. 📱
  • Integrated very small animation. ✨

💻 Two Solutions in Two Branches:

  • Native HTML Solution: Utilizing <details> and <summary> tags without the need for JavaScript. 🚀
  • Accessible Disclosure Solution: Implementing Accessible Disclosure with a11y in mind for enhanced accessibility. 🌐

🛠️ Built With:

  • TailwindCSS. 🎨
  • npm - prettier - prettier-plugin-tailwindcss. 💻
  • 📚 Further Resources:

    If you're interested in creating an Accessible Disclosure, I recommend checking out this informative article by Grace Snow: Tutorial: Let's Build an Accessible Disclosure

Any suggestions on how I can enhance this solution or achieve even better performance are welcome!

Thank you. 😊✌️

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Mohammed Fakih•1,590
    @javascriptor1
    Posted over 1 year ago

    Hi Melvin,

    Excellent solution as always. Your native solution draws my attention to the fact that CSS selectors like:

    :is and :not can work as if condition combined with HTML attributes which makes it possible to get rid of JS code when you have two options to choose from.

    Thanks for your excellent contribution to FEM. I enjoy looking at your code always.

    Regards, MKF

  • Yogi Prakoso•80
    @yogiazy
    Posted over 1 year ago

    Thanks! 👋 I've learned new features from your solution.

  • Finney•3,010
    @Finney06
    Posted over 1 year ago

    Isn't the button meant to close when another button is been click...?

  • P
    DalaScript•580
    @DalaScript
    Posted about 1 year ago

    Hey, Welll done!!

    May I ask you, How do you write Solution retrospective, without this 3 questions and with your own title?

    Thanks in Advance.

  • Ahmed Salem•540
    @websalem
    Posted over 1 year ago

    wow, perfect

  • Sameh•430
    @SamehCode
    Posted over 1 year ago

    what about the main idea of accordion ? when select a topic the rest of topics must be not visible

    https://getbootstrap.com/docs/5.3/components/accordion/

    search for accordion to get the main idea

    i've added link for you from bootstrap accordion check it out

  • Mohammed Fakih•1,590
    @javascriptor1
    Posted over 1 year ago

    I also forgot to mention I could not see the thin line in your solution between questions.

    I wonder how do you solve this usually? do you use <hr> tag? or border-bottom? Or other approaches?

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.

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

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

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

Oops! 😬

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

Log in with GitHub