I created a CSS folder in the application folder and wrote the CSS files in it. Then import them into components for use. They are applied on first load. But when I refresh the page, they are all gone. My folder structure
I tried going back and saving the files again and it worked but disappeared every time I refreshed again.
In the following js, CSS cannot be loaded in each single page component. Can only be loaded inside pages/_app.js
If they need to be called inside a single component, they should be CSS modules.
For example: components/layout.js
In components/layout.module.css
More content can be found here