4 ms·
Haha! I saw this coming. There's still a lot of developers who don't like the idea of css-in-js. It is a bigger topic to debate on. I have personally tried styl
by Gigacore 9y ago
Haha! I saw this coming. There's still a lot of developers who don't like the idea of css-in-js. It is a bigger topic to debate on. I have personally tried styled-components and I like the way it works.
https://medium.com/@gajus/stop-using-css-in-javascript-for-web-development-fa32fb873dcc https://medium.com/@gajus/stop-using-css-in-javascript-for-w...
https://css-tricks.com/the-debate-around-do-we-even-need-css-anymore/ https://css-tricks.com/the-debate-around-do-we-even-need-css...
- davnicwil 9y agoYeah, I was mostly going after a direct comparison with styled-components. I used to be quite happy with css-in-js because of its simplicity but found that it doesn't scale very well to large & complex apps. About a year ago I was introduced to styled-components by a colleague and though initially sceptical (it took me a little while to grok its patterns) I've found it really nice, it solved basically all of the issues I found with scaling styles inside a React app, and I haven't looked back. The only concern I have with it is its not insignificant contribution to bundle size, but that's literally the only thing that would dissuade me from using it on any new project by default. Since it obviously fits so well with the 'React way', and allows you to colocate styles within components with full access to the power of JS for building complex styles dynamically, I just wonder why you'd go for Sass, which is a great but much more general purpose tool, when it exists?