DEV Community

loading...

Discussion on: Styled Components vs. CSS Stylesheets

Collapse
theodesp profile image
Theofanis Despoudis

Styled components are nice but they need more adoption to become mainstream. For example let's say I want to buy an HTML template (because I'm bored to build my own theme from scratch). Almost all the times they are using some sort of preprocessors like SCSS or Less.

Collapse
aleaallee profile image
Alejandro esquivel

Given normal css can't be nested and can be overly complex and large I think SCSS is a good choice when creating HTML templates.

Collapse
lukesmetham profile image
Luke Smetham

import this in a separate file and make it the default export, move all the CSS from your template inside of the template string and then import the file into your global styles.

Then you can still utilize your theme and all the other SC features inside of the CSS provided by your template and customize it however you see fit.

Collapse
lukesmetham profile image
Luke Smetham

I wouldn't say that it isn't mainstream at all, it's a huge library - but I totally agree, it can be harder to implement styled-components as effectively in parallel with things like SCSS and Less which can make it harder to adopt - although you being bored enough to buy a template that doesn't work perfectly with your stack shouldn't be a good pointer of how successful a library is either 😝