3 ms·
Wish I could give this more than one upvote. Having worked on large (30+) teams sharing a single CSS/JS/HTML codebase, styled components is the only sane soluti
by reverius42 4y ago
Wish I could give this more than one upvote. Having worked on large (30+) teams sharing a single CSS/JS/HTML codebase, styled components is the only sane solution -- CSS seems like a simpler way to share styles when you have a few components, but when you have a few thousand it's way more important to isolate changes from each other. CSS in JS still allows for sharing of styles between components, but which styles and how they are shared must be explicitly wired up in JS instead of "cascading" (i.e. magically applying in lots of places). Again, this is a good thing.
- SebastianKra 4y agoI like css-in-js, but it's not the only way of creating isolated styles. CSS-Modules solves it by generating hashed classnames from css-files. Tailwind has global classes, but the styling of each element is local.