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.

📉 Falling 0.4x Web Development
3,785
Comments
20
Years Active
5
Top Authors
#1172
Topic ID

Activity Over Time

2007
1
2008
17
2009
67
2010
100
2011
201
2012
289
2013
294
2014
199
2015
278
2016
236
2017
172
2018
241
2019
189
2020
282
2021
205
2022
285
2023
308
2024
207
2025
190
2026
24

Keywords

e.g US DIV mozilla.org UI HN CSS3 BEM ContactCard i.e css classes styles class style elements html attributes inline attribute

Sample Comments

marban May 18, 2020 View on HN

Without classes, CSS is a race to the bottom.

Tagbert Oct 24, 2022 View on HN

What is the value of a classless CSS system?

nnnnico Apr 24, 2024 View on HN

Writing the whole css syntax as classes is almost like using the style="" attribute, and comes with an enormous css payload cost

bl4ckdu5t Jan 30, 2016 View on HN

What's the benefit of this over having utility classes right in the CSS?

What is "classless CSS"? Just using style attributes?

gotchange Oct 27, 2015 View on HN

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

heydonworks Jun 21, 2012 View on HN

Ancestry driven selectors are the essence of CSS. Classes are a cludge.

devit Nov 19, 2020 View on HN

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.

robertoandred Jul 12, 2023 View on HN

Can we stop appending "class" to everything? It's neither clever or accurate.

johnmaguire2013 Feb 26, 2020 View on HN

If each class does one thing, what's the advantage over using inline styles?