DEV Community

Discussion on: What CSS approach do you use in NextJS?

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan • Edited

styled-jsx 100% (you can use it in Gatsby, too!). I used to be one of those devs who despised CSS in JS and strictly preferred SCSS, but styled-jsx is much better than, say, styled-components. Your CSS is essentially just another component, meaning 1) there's no new syntax to learn—all you need to know is CSS and React, and 2) you can interpolate JS. Also, it uses a variation of CSS modules under the hood to aggressively scope your classes locally.