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

faq accordion with eleventy

accessibility, sass/scss, eleventy
Darek•140
@DarekRepos
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?

It was a big challenge for me to glue everything together. I improved my use of grids and flexbox, but I'd like to work on more projects to become more confident with these layout methods. I learned how to set up an Eleventy project from scratch. Next time I set up a project differently, there are still some improvements to be made. I was very adventurous and excited to create a solution that saves and loads data from a JSON file. I also tried creating a basic component for the FAQ.

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

I learned about accessibility best practices for decorative elements. I also learned more about Sass variables and how to use basic components with JavaScript and Nunjucks. I encountered trouble with links and CSS url() for background images. I also had issues with permalinks when deploying my site, but documentation proved to be a valuable resource. I successfully learned how to import variables in the newest version of Sass. While I initially had problems with links and URLs on the production environment compared to the development server, I was able to troubleshoot and fix the issues. I've learned to think about solutions and check documentation first before getting overwhelmed. It's important to keep things simple and avoid overengineering solutions.

What specific areas of your project would you like help with?

I'm still confused about when to use rem and em. Have you found any resources with good explanations? I'm not entirely sure if my solution fully meets accessibility standards. Is it a good solution? If you find any mistakes or have suggestions for improvement, please let me know. I will be very grateful.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Joramir Jr.•250
    @JoramirJr
    Posted over 1 year ago

    Hi, Darek!

    Your solution looks great!

    Regarding em vs rem, from what I can tell, "rem" is very useful when it comes to keeping a consistent set of spacing on all elements; for example, when using such unit to define padding, all of the spacing will have one base unit, the font-size defined at the root/html element level.

    "em" is useful if we need localized behavior; for example, if we define a "font-size" using em to an element, let's say a button, its padding, or even margin, when set using the em unit, will be adjusted to the font-size mentioned above; the base font-size is no longer the root, in this base, but the "em" font-size defined in the element itself.

    Hope its helpful!

    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
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