Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

QR code component

Yeison Hernandez•10
@Yeison2017
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I wanted to implement the BEM methodology, but I'm not sure if I applied it correctly?

Is there a better way or methodology in naming the variables I use in :root?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • ApplePieGiraffe•30,525
    @ApplePieGiraffe
    Posted over 2 years ago

    Hi, Yeison Hernandez! 👋

    Congratulations on completing your first Frontend Mentor challenge! 🎉 Well done on this one! 👏

    Your BEM looks good! 👍 One small suggestion I have is to set width: 100% on the card component instead of giving it a fixed width. Then, you can set a max-width of a specific value (like max-width: 19.5rem) to ensure that the card component doesn't become too wide. This will ensure that the width of the card can shrink in the space around it ever gets too small. 🙂

    As for naming things, it's really up to you and the people you are working with for what names you choose for things. The main thing to keep in mind is to find and use names that are easy to read and understand so that your code will be easy to read and understand, as well. The names you've chosen in your project look good to me! 😉

    Hope you find this helpful. 😊

    Keep coding (and happy coding, too)! 😁

    Marked as helpful
  • Imran Khan•370
    @astr0n0mer
    Posted over 2 years ago

    Hi @Yeison2017, you're off to a great start

    Some corrections as you're using BEM

    • The <div> with class="cardQR__content" is a block and should have its own name, maybe "content"
    • And then the children will be "content__title" and "content__info"

    You can consider these resources for expanding your knowledge on BEM:

    • 🎥 Why I use the BEM naming convention for my CSS
    • 🗒️ BEM 101 on css-tricks

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

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

Oops! 😬

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

Log in with GitHub