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

Article Preview Component - Did I make this accessible enough?

Roy•195
@royschrauwen
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hello everyone! 👋

Woohoo! This is solution number ten for me 🎉

I have been self-learing since May 2021 and besides just learning about HTML, CSS and JS, I am also trying to learn about accessibility and responsiveness.

❓️ Specific Questions

  1. I ran my first solution for this challenge through an Color Contrast Accessibility Validator and the colours in the design did not have a high enough contrast, so I converted the colours to HSL and lowered the lightness untill they passed. Is that ok? Is this something you usually discuss with the designer?

  2. I also made the font slightly bigger for better readability. Ok or also a designer choice to make it, in my opinion, too small?

  3. I changed the outline when the button gets focus to a color from the design. Is this a good thing to do of better leave it alone?

  4. Did I give every item that needs accessibility label and alt, etc, in the right way?

I would much like to become a better developer, so any advice you can give me is very welcome, also if it does not regard my specific questions.

Have a nice day! 🙋‍♂️

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Shahin NJ•1,190
    @SJ-Nosrat
    Posted almost 4 years ago

    Hi Roy, Beautiful solution! A lot to learn here for me! With regards to your questions find below in my humble opinion:

    1. Part of Web Development, besides making websites beautiful and aesthetically pleasing, there's the user experience issues and this is a broad topic: however we must consider the user experience of individuals that have issues with their eyesight eg: colorblindness, contrast, etc. It's too broad a topic; which requires for us to be part of a TEAM and discuss, develop and implement such issues.

    2. This again relates to bullet point (1).

    3. That's fine! Draws the user's attention to having the button in an active state (visually speaking).

    4. I would direct to think about using semantic HTML that's why they've been introduced natively for HTML 5. Also, for accessibility reasons: include the aria-hidden="true" attribute for the following element: <div class="main__image"></div> since I'm sure it's being used to apply a background-image.

    5. I noticed when you mouse click on the share button, I'll have to click the share button again to collapse the options, can you make it so that clicking anywhere on the screen will collapse the options as this is more convenient.

    Lastly: could you teach me about the below code in your <head>:

    <meta name="twitter:card" content="summary_large_image" />
        <meta
          name="twitter:title"
          content="RS | Frontend Mentor | Article preview component"
        />
        <meta
          name="twitter:description"
          content="Read this article: Shift the overall look and feel by adding these wonderful touches to furniture in your home!"
        />
        <meta
          name="twitter:image"
          content="https://raw.githubusercontent.com/Lumensum/FEM-article-preview-component/master/screenshot.png"
        />
    

    What does the above code do in your HTML structure?

    In Summary: your approach is correct and considering accessibility is the job of the Frontend Developer; having said that, this involves working part of a team and bouncing off such issues that you bring up.

    Hope the above helps!

    Best of luck with your coding journey!

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