Design comparison
Solution retrospective
Hi, I'm new to using BEM and SCSS. Please help me to check:
- How did I name HTML elements following the BEM naming convention?
- How did I structure my project and the SCSS files and structure code in each SCSS file? Thank you all.
Community feedback
- @soransh-singhPosted about 3 years ago
BEM means Block Element Modifier In your code Block will be
.pricing-card
then in
.pricing-card
element will be the buttons and text so you will name them.pricing-card__btns .pricing-card__text
one card is different from the other cards so you need modify bg-clr and clr of that card then you can add modifier to it like
.pricing-card--accent
or something.Similarly you can modify btns and text by adding class
card__btns--accent card__text--accent
.you can look this link they have explained better.
0@anOldChildPosted about 3 years ago@soransh-singh Thank you for your suggestion. What I meant in my question is I already tried to write HTML with BEM, so can anyone take a look at it and comment about the way I did it. Sorry if I didn't clear myself on that.
0@soransh-singhPosted about 3 years ago@anOldChild yhaaa .... that is what I thought ... you have done great job with BEM and scss...
The only thing that I would had changes is that instead of first-of-type and last-of type, I would had used a modifier class (but that's only personal preference)
Marked as helpful0@anOldChildPosted about 3 years ago@soransh-singh Yeah, thanks a lot for that suggestion.
0
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