Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

3 Column preview card - SCSS - Mobile First

accessibility, sass/scss, bem
P
Luciano Lima•1,270
@LucianoDLima
A solution to the 3-column preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Any feedback is welcome.

I tried to implement the BEM method but still not sure if that's how it works, so I'll keep working on that

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Rafael Takano•180
    @rafaeltakano
    Posted about 3 years ago

    Hi, Luciano! 👋

    Nice work on this challenge! ✌ Your solution is responsive and looks great! 👍

    About BEM, it is a methodology that has Blocks, Elements and Modifiers (B.E.M).

    Blocks that have Elements related to it should be named [Block]__[Element]

    And only modifiers should have the double dash [Block]__[Element]--[Modifier]

    An exemple:

    //css
    .button {}
    
    .button__text {}
    
    .button--green {}
    
    .button--blue {}
    
    //html
    <button class="button button--green">
          <p class="button__text"> Green Button </p>
    </button>
    
    <button class="button button--blue">
          <p class="button__text"> Blue Button </p>
    </button>
    

    I hope this helps!

    Marked as helpful
  • Danilo Blas•6,300
    @Sdann26
    Posted about 3 years ago

    Hello Luciano!

    By itself all projects should only have at most a single h1 per page, so I would recommend you to change all your h1 to h2. Although if you do that you will get an accessibility error that there is no h1, so to avoid that error we can do the following:

    • In the main place an h1 with the title you want.
    • Add the class sr-only.
    • To the class place the following attributes:
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0,0,0,0,0);
      border: 0;
    }
    

    The main reason that we will do this is so that the title does not appear in the flow and the design does not look bad but nevertheless the screen reader detects it to avoid this error. In if the sr-only is used for accessibility issues but in this case we will use it for this, if you want to know more look for accessibility on the web.

    Your project has a very good design and is responsive, the truth is that it looks pretty good, I hope my advice has helped you.

    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.

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