4 ms·
Does Angular natively solve at least part of the problems that Tailwind / CSS-in-JS with the way it scopes it's CSS? With Angular, it's generally quite simple
by nraf 6y ago
Does Angular natively solve at least part of the problems that Tailwind / CSS-in-JS with the way it scopes it's CSS?
With Angular, it's generally quite simple to figure out where the CSS for a component lives (it's literally right there in its own file alongside the component).
Sharing common values (e.g. colors, borders, paddings, etc) across classes was the biggest issue we faced, so I can see Tailwind being useful there.
In our project, we've somewhat solved it through a mix of sensible base styles and classes ('btn'), custom classes (e.g. `clr-primary--500`), CSS variables (e.g. `--clr-primary-500`) and SASS mixins / functions. It also makes it really to switch out themes dynamically, switching b/w dark and light modes for example, just requires switching up the CSS variables.