Classless CSS Debate
The cluster centers on debates about 'classless CSS' approaches that avoid semantic or utility classes in favor of element selectors or inline styles, weighing their practicality, benefits, and drawbacks against traditional class-based methods like BEM or CSS modules.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Without classes, CSS is a race to the bottom.
What is the value of a classless CSS system?
Writing the whole css syntax as classes is almost like using the style="" attribute, and comes with an enormous css payload cost
What's the benefit of this over having utility classes right in the CSS?
What is "classless CSS"? Just using style attributes?
Web devs have been using presentaional class names to style HTML elements ever since there was CSS around. So, this is not something new. What's new though is your recommendation to use class names as the exclusive method of binding between CSS and HTML, which in my opinion is not practical and moderately limiting for the aforementioned reasons I listed in a prior reply.Also, it's worth mentioning that class naming and achieving consistency and predictability throughout a project is
Ancestry driven selectors are the essence of CSS. Classes are a cludge.
It's wrong because it's useless: you can use inline styles instead (and if you gzip the html it's probably going to be smaller as long as you factor in the framework, since essentially you are using numeric LZ backreferences instead of useless long class names).The whole point of CSS classes is that they don't map to fixed styles, so they offer a useful abstraction, allowing you to change the CSS class definition once and effect all elements it applies to.
Can we stop appending "class" to everything? It's neither clever or accurate.
If each class does one thing, what's the advantage over using inline styles?