Hacker News new | ask | show | jobs
by goofballlogic 2411 days ago
I think this is an issue which needs to be addressed a bit more holisticly. The fact is that HTML, JavaScript and CSS (to name three) all use an element's _className_ for slightly different purposes.

The author seems to consider BEM an example of a _semantic_ CSS scheme, but really the semantic needs to be clear across all the consumers of the API being implicitly established by the markup.

Ultimately HTML is the original source of a web page, with CSS and JavaScript often augmenting this. For that reason, I think it makes sense to opt for the HTML spec's definition of _className_ semantics when there is a clash.

The spec effectively balances the importance of both CSS and JavaScript (or other user agent) uses, but cites an example useful to both:

https://www.w3.org/TR/1999/REC-html401-19991224/struct/globa...