DEV Community

Discussion on: Bum(S)CSS – Conventions for writing lazy and pragmatic CSS

Collapse
 
amiangie profile image
am i angie?

I feel like we have been through all this before, maybe even a couple of times :) The fact that you're taking into consideration order of styles is great, have a look at ITCSS, which takes it a step further.

What caught my eye are modifier classes like _blue or _big. In my experience, it is better to avoid naming things based on their appearance, and instead stick to their semantics, so eg button becomes _primary or _secondary. While _blue might seem like a great name at the time, what happens if design changes and _blue button becomes red? You'll need to either refactor all of the code to change class names to _red, or live with inconsistency between naming and appearance.

Collapse
 
johannesjo profile image
Johannes Millan

Thank you very much for the suggestion. You're right about the class names and I haven't heard about ITCSS before. It's very interesting stuff though I've yet to find an article digging deeper into the class structure. I probably will work this into the approach one way or another.

Collapse
 
johannesjo profile image
Johannes Millan

Reading a little bit more about ITCSS I figured that they are using almost the same naming conventions as BEM. Imho this makes the html very convoluted and reading and writing it harder than it should be. On the other hand I like the little pyramid. Combine both approaches with each other should be no problem.

Collapse
 
amiangie profile image
am i angie?

Personally, I think BEM is great and not hard to write or read at all - but that's indeed the thing, you don't have to use it in pure form with ITCSS if you don't want to; you can combine inverted triangle approach with pretty much any naming convention you want.

Glad I could help :)