Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

FAQ Accordion

astro, tailwind-css
P
Tsukimi•820
@hikawi
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm most proud of completing the challenge of not using JS for the solution. This was made completely in Astro components with no (or as little as possible) JS footprint.

What challenges did you encounter, and how did you overcome them?

Had some troubles with fluid typography as the library wasn't able to recognize arbitrary Tailwind values, just having to add those styles needed in the tailwind config and everything worked again.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Levi•230
    @law973
    Posted 9 months ago

    Hey! I think your solution is great overall, with the box shadow in particular standing out to me (mine wasn't that smooth).

    A couple of quibbles:

    • The challenge does mention being able to "see hover and focus states for all interactive elements on the page", so I would use the :focus pseudo-class to make the summary texts turn pink when they are selected.
    • For some reason, the file provided for this challenge has the words "Frontend Mentor" inserted into the last summary question, which doesn't correspond with the design preview that they want people to try and match. I'd remove those words so that the last question can fit on a single line in the desktop view, which matches the requested design (and arguably looks better).
    • There is a minor typo in the page title.
    • I think it'd be slick if the mobile background image and the desktop background image had the same height when switching from one to the other (but that's more personal preference and not an issue really).

    The sizing, spacing, and responsiveness are on point, so all in all I think it's pretty nice. Keep up the good work!

    ...

    (This comment got kind of long. I guess you could say...)

    Marked as helpful
  • Wendy•2,150
    @wendyhamel
    Posted 9 months ago

    Hi! Great solution to this challenge!

    Your solution is very much like the design and your code is very readable. I had to look hard to find anything to comment on. 🙂

    Nice to see you use the details / summary HTML solution.

    Accessible, pure HTML. Great.

    You could consider putting the elements in a list, to let users (screenreaders) know it is a list of questions grouped together.

    I never worked with Astro, so I can't comment on that.

    Happy Coding!

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 all CSS, SCSS and Less files in your repository.

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.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

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