Skip to content

Comment on CSS Classes Considered Harmful

Comments

The article did a good job of explaining the problem of codifying a style ontology using only clases, and proposing a solution to that problem (custom attributes and pseudo selectors for specialization). It did not convince me that classes themselves were bad, and replacing them with custom tags doesn’t seem to solve anything. The main argument advanced against classes (as opposed to certain ways of using classes) seems to be that they are old tech, which doesn’t make much sense to me. Did I miss something?

The main problem (as described) is that CSS classes don't take parameters. Imagine coding in Foolang and its classes don't take parameters, resulting in class explosion.

Author goes on to show how to give them parameters, news at 11. ;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.