Search code examples
configurationfrontendglobalnext.jsnode-sass

How to configure global and local stylesheets in next.js >= 9.3 config?


I have seen that next.js support built in sass support for global styles and also support for sass modules from ^9.3. However, I would like to define the configuration in a way that separates the global styles ( e.g., style sheets for normalize) and component level styles. It would be great if someone provide me with next.config.js file for sass configuration?

Thank you in advance!


Solution

  • You don't need a special config.

    Next.js has a built-in support for "global" style, if you import the styles from _app page it will be global.

    All the rest of the styles will be css module.