3 ms·
In theory there's nothing CSS can do that JS can't, as long as the browsers provide the equivalent API for it. Any other performance difference will go away onc
by uyt 5y ago
In theory there's nothing CSS can do that JS can't, as long as the browsers provide the equivalent API for it. Any other performance difference will go away once they devote some resources to optimizing it.
The real question is whether we want styling/theming to be in it's own domain specific language. From an ergonomics standpoint, CSS is such a bad language we would rather write JS instead. But the downside of not having it in a more restricted language is that it's much harder to build tooling for it. For example, you won't be able to open up any webpage and know you can inspect and change the style of things. Instead you need to know the specific JS class for that component or ThemeProvider and modify that instead. Every ui framework is going to do things slightly differently which will be a huge blow to user customizability.