4 ms·
I’m curious, what is the benefit from going “classless”? In my CSS usage, classes have been very useful. Why would you not want to use classes?
by Tagbert 3y ago
I’m curious, what is the benefit from going “classless”? In my CSS usage, classes have been very useful. Why would you not want to use classes?
- Looky1173 3y agoI'm not against classes at all. I believe they are essential to constructing a well structured website, especially for creating layouts. However, I also believe that as frontend developers we should embrace native and semantic HTML elements instead of reinventing the wheel and rolling our own solutions. Going classless for basic elements results in cleaner HTML markup and avoids "class pollution".
- gbalduzzi 3y agoI think it's not about going completely classless, but about having sane defaults and only use classes for specific components and/or elements that really need a custom style. The more traditional CSS libraries provide ton of classes, and your html is filled with classes for the basic styling.
- Looky1173 3y agoExactly! You shouldn't need to remember classes for styling native HTML elements, and neither should you be forced to type out <button class="button"></button>, where you would be repeating yourself.
- Tagbert 3y agoThanks for the feedback. That is pretty much how I have approached things but I was wondering if I was missing some “gotcha” about classes.