Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Single Price Grid Component solution

@oryanhach

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Having hard time naming CSS classes. I would appreciate any feed back on that subject or any other you think I need to improve! Much thanks!

Community feedback

Damjan 220

@iDamjan

Posted

Hi Oryan,

You will find out in a short time that actually hardest coding challenges are related not to actually coding but coming up with names :D Starting from naming function to CSS classes.

The thing that helped me the most was following a standard or lets say architecture, and thats the BEM standard, which stands for Block-element-modifier. With this standard you will not have to think much as the standard it self will think for you.

You can read the docs here : https://getbem.com/introduction/ BUT basicly how it goes its you have a block in the HTML lets say <form> and some children inside <button> or <input>, the main class of the block will dictate the main name and the children or elements will be the name after the block ex. Form---button, Form--input or Form--contactButton and then the M in the BEM standard which stands for modifier will be for example if you have some modified state ex. Form--contactButton-disabled, Form--input-error.

There you go, CSS naming solved :P I hope this helped.

I will also suggest for you to try SCSS, which is just another way to write CSS. It changed my life and i would never come back to write normal CSS. :))

Marked as helpful

1

@oryanhach

Posted

@iDamjan Thanks a lot! I have used SCSS a little bit in the past, I need a refresher on that for sure! Also I have added BEM tutorials to my list now. Thanks again, appreciate that!

0
Guli 70

@GulshanoyIbragimova

Posted

Hello Oryan!

I also had hard time naming classes then this article from freeCodeCamp came very handy.

You can have a look 👍🏻

1

@oryanhach

Posted

@guli10 Thanks for the response, could you please provide me with a link to the article?

0

@oryanhach

Posted

@guli10 did a little searching, I think you maybe was referring to this link:

https://www.freecodecamp.org/news/css-naming-conventions-that-will-save-you-hours-of-debugging-35cea737d849/

seems pretty good and will for sure help me a lot! Thanks!

0
Guli 70

@GulshanoyIbragimova

Posted

@oryanhach

You are welcome!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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