Interesting opinion about semantic css naming

alexanderisora
Thu, 07 May 2020 13:31:18 +0000

I agree with you. HTML code becomes clumsy if you apply too many utility classes. You also get a less independent CSS.

I prefer using BEM methodology and often break the DRY (do not repeat yourself) rule just to keep my HTML code clean.
Example:

HTML:





CSS:

.widget{
    background-color: white;
}

.plugin{
    background-color: white;
}

See, I repeat myself like a noob
But at the end of the day, I spend less time fixing or customizing my modules.

The good thing about over-using utility classes if that you can instantly onboard new team members: they do not need to learn much to start editing your code.