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

Responsive Layout Done With Vite + React

KoliaK•160
@KoliaK
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


It was really interesting to make my own "summary" instead of using the classic HTML

<details>
    <summary>Title</summary>
    <p>Content</p>
</details>

I guess it was difficult to work with those imagens on top of another, and the BG ended up overflowing the Card component. The only way I think of making the BG work as expected, is to make another app, without using the Card component as a displayer to other components. Any ideas?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • BrunoMoleta•700
    @brunomoleta
    Posted almost 2 years ago

    Hey Koliak, I'm testing your app in the mobile width, and the illustration can't be seen. You may correct it with a margin-block: 8rem or so.

    About your questions, I believe that in a "real life" project, perhaps those two top "rings" should be given to the developer in the same svg of the desktop image, as... they only appear along with it. I wouldn't worry about that.

    I see that you saw it as a valuable idea not to use the details tag. I would stick to the native tag, as the div's you used carries no semantic value.

    However, you can compensate the semantical gap with region: role. Check it out, as you may find a good use for it.

    You will probably need some ARIA as they, according to MDN:

    ARIA roles provide semantic meaning to content, 
    allowing screen readers and other tools to present and support interaction with
    an object in a way that is consistent with user expectations of that type of object.
    
    ARIA role is to describe elements that don't natively exist in HTML
    or exist but don't yet have full browser support. 
    

    I would also consider making the accordion open only one question at a time, as the way it is set, the illustration slides downward, and it's perhaps not the best user experience. It was not a requirement of the challenge, but it is a nice feature.

    Keep the hustle :)

    Best regards from Brasil 🇧🇷

    Marked as helpful

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

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