Replies: 4 comments
-
I tried to do it (migrating from next-css) but seems like you can't do it currently. You can read the reasons here: https://github.com/zeit/next.js/blob/canary/errors/css-npm.md#possible-ways-to-fix-it |
Beta Was this translation helpful? Give feedback.
-
I've tried to import the global CSS inside a |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
You can provide it via a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The new build-in CSS and SASS support expects the global styles to be imported in the
pages/_app.js
. The reason is to avoid class name and ordering conflicts, https://nextjs.org/blog/next-9-3#built-in-sass-support-for-global-stylesheets.Question, how the global styles should be imported on demand?
Example: using third part components that are loaded on demand and aren't used frequently. Makes no sense to download their stylesheets for the whole app.
Beta Was this translation helpful? Give feedback.
All reactions