
Have you used styled components and what do you think about it? - botvader
Almost ready with a simple tool to translate CSS as styled-components that I plan to launch this week. 
I just wanted to know what do you guys think about styled-components?
======
oliverx0
I love styled components for React. They are a great way to separate the
styling logic from JSX, yet keeping it at a glance in the same file as the
component. Essentially, you don’t have to remember CSS classes name. It is
also a great way to have very granular styling when needed. The fact that you
can encapsulate the component in another styled component makes it so that you
can have general styles and more specific ones whenever you want. I would
personally recommend it over css files for any react project.

Also, if you are using a react framework such as material UI or ant design,
styled components make it very easy to change the style of those without
braking anything.

------
taf2
You mean [https://www.styled-components.com/](https://www.styled-
components.com/) ? I am curious how the components can be themed? My
understanding is web components use shadow dom isolating their dom tree from
the outer document so wasn’t sure if it is possible to have an outer document
css file provide theme colors to the components?

~~~
botvader
Are you asking something along these lines: [https://css-tricks.com/styling-a-
web-component/](https://css-tricks.com/styling-a-web-component/), not clear on
how both questions are related.

------
stockkid
I do not think that it provides much more value than other simpler solutions
already do. I might be wrong, so please correct me, but the main problem
styled-component solves is already solved by css-module. In this light,
styled-component seems an unnecessary abstraction and a whole new set of APIs
to learn for no tangible benefit.

~~~
botvader
can't provide props aka the theming options in `css-modules`. I think,
`styled-components` seems like an extension to css-module.

