DEV Community

Discussion on: Introduction to styled-components

Collapse
 
ivandack profile image
Ivan Dackiewicz

Hi David. I think Andrés means that with styled components you have all the styling code in the component, which is great to have that component as standalone, but means that you have to rewrite or copy the common styles that are more global or part of the theme when you are working on an app.

Also, the component file may end up being huge, with most of the content being style. Annoying to maintain.

Personally I'm trying a mix between Sass for common styles, and styled components for specific component styles. I won't recommend this yet because I'm still trying it out.

Thread Thread
 
arshadayvid profile image
David Asaolu

Oh! now I get it. I agree with you on this. Rewriting the styles can be timing consuming and huge components😖

Nice, I actually use my index.css file for common styling or copy the styles sometimes.

Thread Thread
 
andresausecha profile image
Andres Ausecha Mosquera

Yeah, after 6 years as fullstack dev I found SASS the best tool for frontend styling, taking into consideration syntax, size, performance and maintainability. In any way, it's a matter of preference, if you like styled components and works for you then go ahead