As someone who’s building a React-like framework (though entirely in Haskell), this is something that is really tempting to me. I completely agree that CSS is not composable and akin to a huge soup of globals. Does anyone know if there’s been any more discussion on this topic? I’m most interested in knowing how well a browser would deal with something like this.
We looked into it briefly for our project. We actually concluded that we’d rather stick to SASS, but try to educate our team as to how to write maintainable CSS.
I still find the approach interesting. It pushes ReactJS even more into “immediate mode rendering” territory.
I think css is more of a dev problem then a tech problem. The browser can handle the work efficiently, that’s probably why it’s never needed to be changed. The problems come when devs need ways of keeping tracks of changes to all those globals without stepping on each others toes.
I came across react-style recently which lets you declare all your styles inline and the pulls them out at build time. I haven played around with it though. Not sure what the experience is like in practice.