I would be the first to agree that there are problems with CSS, I use it nearly every day and I run into these problems quite a lot. But moving to the JS to attempt to solve these problems is taking several steps backwards to me.
All the problems you list in your example I would say exist as potential problems in any other aspect of a large-scale project. In most of the examples I've seen the problem seems to be giving developers who don't know CSS access to CSS and then wonder why it eventually falls apart.
Personally, I agree that deviating from CSS syntax is not a viable solution for a large number of cases, and neither of those solutions is perfect. I just think it's cool that people are experimenting with different ways of creating collision-resistant styling tools, rather than sticking w/ the status quo.
Scoped CSS[1] would have been a good start, but unfortunately it looks to be in trouble (removed from Chrome).[2]
[1] https://html.spec.whatwg.org/multipage/semantics.html#attr-s... [2] https://www.chromestatus.com/features/5374137958662144
You can't have proper modules that you just plugin in. I want a button styled a way... it will mix with some other default button. I have to create many button classes.
But you can have proper modules that you just plugin. If you plop in your button and it conflicts with someone else's button; then one of you did it wrong. The solution is to create multiple button classes as you say, but this Javascript solution does the exact same thing.
But with this lib I don't care about classes. I just put thing in, and I have 0 conflicts. I can do whatever I want and no conflicts. Try that in css. Also take a look at react.js this lib is perfect fit for that.
The most common answer I've seen is "because I don't want to learn CSS", which I don't feel is a good enough answer.
I can write CSS all day using classes that do not conflict in the manner described.
The problem this tries to address is the problem of maintainability when the entirety of the codebase doesn't fit in your head (because you have many people committing CSS at a fast pace, or a lot of junior devs, or because the codebase is large, or old, or the deadline is too tight, or any other number of reasons)
There's a world of difference between Facebook with its hundreds of devs commiting code to the same codebase over the span of many years, vs an agency where it's typical for one frontend person to own the entirety of the CSS codebase for a month-long project. In the latter case, you usually don't need the ability to scale the team (or can get away with enforcing ad-hoc processes). In the former case, having tooling that enables non-clashing class names by default is worth the trade-offs.