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

3 column preview card component

bem, vanilla-extract
dps99•40
@diegop985
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


Hi Everyone, I've been practicing HTML-CSS nonstop and I think the results are finally starting to be noticeable, for this challenge I took the CSS code order/aesthetic very serious. I start using BEM and try really hard on responsive. If you want, pelase take a look and leave a feedback, it really helps me. 😅

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Noemi Gali•280
    @NomiDomi
    Posted over 3 years ago

    Hey @diegop985,

    Really good job! It is very obvious that you've been looking into things.

    Good use of the different types of units and CSS selectors.

    Here are some tips on my side:

    • try to keep your class names even more generic. I can see that for the different type of cards your chosen names are card--orange, card--blue, card--green. Try using card-1, card-2, card-3 instead. The reason for this is because in a production environment maybe you change your mind and you choose completely different colors for your card. The orange card becomes pink, the blue card becomes purple and the green card becomes blue. You can see the confusion that might create. Now think of if you work in a team and someone else comes and looks at your code. They might go straight to your CSS and change things for your card--blue, but instead of changing the current blue card they will be changing the purple one.
    • I see you decided to used different type of name conventions for your class name: card--orange, card__icon. Best practice wise you should use the kebab case where you put only one dash - between your words. So if I were to rewrite your classes card--orange becomes card-orange and card__icon becomes card-icon.
    • it is amazing that you are using CSS variables and you take your colors from there. I would encourage you to do the same for your font family, sizes, weights etc.

    Here are some useful videos:

    • Improve your CSS by Keepin' it DRY
    • CSS variables

    Hope this helps! Keep coding! :)

    Marked as helpful
  • Shraddha•465
    @5hraddha
    Posted over 3 years ago

    Hi @diegop985, First of all, great job 👏 There are a few suggestions for improvement that I would want to give:

    1. Instead of using <div> as a container element every time, it would be great to use semantic tags like <header>, <main>, <section>, <article>, etc. You could look for them on MDN. The benefit of using them is that they provide a semantic meaning to the markup inherently and help screen readers for accessibility purposes too.
    2. When you have a list of cards to display (as in the challenge), you could make use of <ul> and put each card as a list item. Or if you want to further enhance your markup, you could use <template> that can store markup for one card and then, could use JS to clone the template and create as many copies as you want.
    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

Oops! 😬

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

Log in with GitHub