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.
Having Travis CI running a test suite helps here: you can automatically see if the tests pass before hitting the merge button. Your tests could also include things like linting to check the code is formatted to your project’s spec, of course.
The first approach to reducing overheads should always be automation where possible.