DEV Community

Discussion on: Let's Take a Look at CSS in JS with React in 2019 - Styled Components

Collapse
 
adrianhelvik profile image
Adrian

For regular CSS: You get rid of global styles.

Say you write a component somewhere that uses the className 'container'. Then you can't use it in any other component style sheet without getting a conflict.

With CSS modules that is not a problem. The selling point against CSS modules is that you get more power. It lets you conditionally apply styles and build styles based on props.