CSS inside "pages" in nextjs
CSS inside "pages" in nextjs
我可以将 .css
放入 Next.js 应用程序的 pages
目录中,然后使用 import "./my-css.css"
从我的页面导入它。
不过,这是一个好习惯吗?会不会导致路由问题,还是会被路由器忽略?
在docs it states "Every .js
file becomes a route that gets automatically processed and rendered." It also looks possible to change what extensions are used: https://github.com/zeit/next.js#configuring-extensions-looked-for-when-resolving-pages-in-pages
所以我不认为那里有一个 .css
文件会导致路由问题,但我也不认为仅仅因为我不期望任何东西就把它们放在那里是一个好习惯但是页面在 nextjs 应用程序的页面文件夹中。
我可以将 .css
放入 Next.js 应用程序的 pages
目录中,然后使用 import "./my-css.css"
从我的页面导入它。
不过,这是一个好习惯吗?会不会导致路由问题,还是会被路由器忽略?
在docs it states "Every .js
file becomes a route that gets automatically processed and rendered." It also looks possible to change what extensions are used: https://github.com/zeit/next.js#configuring-extensions-looked-for-when-resolving-pages-in-pages
所以我不认为那里有一个 .css
文件会导致路由问题,但我也不认为仅仅因为我不期望任何东西就把它们放在那里是一个好习惯但是页面在 nextjs 应用程序的页面文件夹中。