Stop using CSS in JavaScript for web development
Gajus Kuizinas
3.4K95

I have always struggled with organizing and structuring my CSS in a fashion that makes it more manageable. I am using styled-components for the first time in my current project and I am more organized than ever. Might be because the React component pattern is more aligned to how I think. For me using JS to compile styles is no different than Ruby to compile styles in SASS. The fact remains that currently CSS lacks some of the tools required to make styles more manageable. The one disadvantage of breaking out all your styles into components might be performance. As we saw last week though you can mitigate this by calling the component as a function passing in the props instead of using JSX directly. Pretty sure this issue will be addressed in React Fiber though. Thanks for the article! Nice to be able to quickly see what peoples opinion is on this subject.

Like what you read? Give Yves Richard a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.