Time to face the brutal truth
Ever wanted to redo CSS all over again, but with a new tool/framework?
What is it?
But is the hype well-deserved or are developers being led astray?
Let’s get the first thing out of the way.
So then why not use styled-components for all projects?
The question I want to pose, would people still use it if they knew they are leaving 30% or more money on the table? No, they wouldn’t care about it at all.
But in certain cases, it does affect the revenue of your app. One thing I learned during my time creating web apps for phones is that NOT all people (surprinsingly) use the latest iPhone. There are still people who use devices with Android 4.4.4. I know, unbelievable!!!
So before you create your new project with this technology (or before you change the current one in production), take a minute and consider how important is performance to your app.
I couldn’t really find on the internet an article which talked about this, but it made sense to test the hypothesis that modular CSS may be more performant. So I spent a few days and switched the entire codebase of an in production app from styled-components to modular CSS.
Pain points of styled-components
- one extra package
- bigger JS bundle
- affecting CSS performance? (what we’re trying to find out here)
- CSS files and JS files are not processed…