Design comparison
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?
Community feedback
- @ApplePieGiraffePosted almost 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 (likemax-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 helpful1 - @astr0n0merPosted almost 2 years ago
Hi @Yeison2017, you're off to a great start
Some corrections as you're using BEM
- The
<div>
withclass="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:
Good luck. Happy coding 😁😀
Marked as helpful0 - The
Please log in to post a comment
Log in with GitHubJoin 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