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

Animated Article preview component

accessibility, animation, bem
Alberto José•630
@alberto-rj
A solution to the Article preview component 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?
  • What would I do differently next time?
    • See the Continued development section of my README file
What challenges did you encounter, and how did you overcome them?
  • See the Challenges faced section of my README file
What specific areas of your project would you like help with?

I'm trying to improve my documentation skills, so if you could read my README and propose improvements, I'd certainly appreciate it. 👍 🚀

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Gwenaël Magnenat•1,540
    @gmagnenat
    Posted 12 months ago

    Hi, congrats for completing the challenge, your solution looks great ! I worked on the same challenge recently following the JavaScript learning path and yours was picked up for a review.

    I did some tests on your solution and checked your repository. I can give you a few comments to improve this solution or to open a discussion on it.

    I like the css animations. that's cool !

    • The drawer image should have a meaningful alt text. I don't think this is purely decorative.
    • The avatar image usually are meaningful as well and need an appropriate alt text
    • I wonder if the aria-haspopup is appropriate on the button as you already use a disclosure with aria-expanded
    • You use a menu role and menuItem on the disclosure content. Not sure this is appropriate as it ads a lot of verbosity and misleadinging informations when using a voice over. It should be more concise like "share this content on Facebook". For example it mentions a close interaction with the escape key that doesn't work on your solution. Probably something to check and confirm.
    • I don't think you need two copies of the button. You can use a single one and position it over the disclosure content on mobile.
    • In general in the css, I would recommand to use a full modern css reset at the beginning
    • I recommand to use more meaningful variable name instead of a, b, c, d and 1, 2, 3, 4. It will increase the readability, make it easier to debug.
    • You could use the aria attribute to style the disclosure instead of adding open and close classe to simplify your css and javaScript.
    • Some interactions are missing for me here. The only option to close the disclosure is by clicking the button a second time. I would like to have the "escape key" option and a light dismiss (when the user click an area anywhere but the button).
    • There is an issue with the button to close it. If you click on the svg pattern the click is not handled. Maybe something with pointer-events:none on the svg can fix this?
    • Still on this share button, the svg is purely decorative. By default it is brought in focus by some screen reader and voice over. It just reads "image" without any more informations. To avoid this, add focusable="false" to the button's svg.

    I hope you find these comments helpful and it helps you improve this solution to make it even more accessible. Reach out on discord if you have any questions or want to open the discussion on these comments.

    Happy coding !

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

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

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

Log in with GitHub