Mobile-first job listings with filters using Vanilla Javascript
Design comparison
Solution retrospective
I would like to get advice on how to avoid repetitive code in CSS. (I am aware of the BEM theory, but I struggle in the practice). Thanks in advance :)
Community feedback
- @dwhensonPosted about 3 years ago
Hey @sofiaperezm - I've been using this approach for organising my CSS: https://cube.fyi/ I've found it really useful. Especially, the idea of using 'blocks' and 'utility' classes. The latter being really useful. It's worth and read.
Marked as helpful1@sofiaperezmPosted about 3 years ago@dwhenson thank you for your input. I'll definitely take a look at it
0 - @Theo-fluxPosted about 3 years ago
Hello sofia, to avoid repeating your codes and all try using Reactjs. It allows you to abstract your codes into components that can be reused. Thanks
Marked as helpful0@sofiaperezmPosted about 3 years ago@Theo-flux thank you for your feedback! Yes, React is definitively in my learning path
1 - @martindb1988Posted about 3 years ago
CSS works from top to bottom so once a style is defined the DRY method comes in place. Good use of CSS variables but i would look into your class and id naming with __ and — i found that very confusing.
Marked as helpful0@sofiaperezmPosted about 3 years ago@martindb1988 Hi Martin, thank you for your input. For the class naming, I was trying to follow the BEM convention http://getbem.com/naming/ but as I said, I believe I struggle using it.
0@martindb1988Posted about 3 years ago@sofiaperezm I can see why you did it, personally i’m not a big fan of BEM ( yet ).
0@sofiaperezmPosted about 3 years ago@martindb1988 I understand, I'll maybe try out another convention in my next challenge. Thank you for your feedback Martin!
0@martindb1988Posted about 3 years ago@sofiaperezm Sure no problem :) let’s just improve each others coding.
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