How to style Next JS
Next.js uses React, you can use any other mechanism that works with React to style your apps.
Next.js has built-in support for CSS and Sass which allows you to import .css
and .scss
files.
Next.js includes Styled JSX by default, but you can also use other popular CSS-in-JS libraries such as styled-components or emotion.
Styled JSX is a CSS-in-JS library that allows you to write encapsulated and scoped CSS to style your components. The styles you introduce for one component won't affect other components.
Next.js example app with styletron
In order to use Base Web, you need to do a small setup and wrap the root of your application with StyletronProvider
and BaseProvider
components.
Last updated