TailwindCSS 样式未应用于 Nextjs 服务器端

时间:2021-03-26 23:17:45

标签: next.js tailwind-css

我正在关注有关如何在此处集成 TailwindCSS 和 NextJS 的教程:https://tailwindcss.com/docs/guides/nextjs

一切正常。我可以完成工作并在我的主页中看到一些样式。但是,这些样式仅应用于客户端。我检查了网络选项卡,我只看到没有任何背景的“家”这个词,而不是我设置的灰色。

这是它在浏览器上的样子:

enter image description here

这是从服务器上生成的内容在 Chrome 预览中的外观:

enter image description here

这是我的代码:

Tailwind.config.js enter image description here

postcss.config.js enter image description here

_app.js

enter image description here

我哪里做错了?其他人有同样的问题吗?

0 个答案:

没有答案