This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Global CSS (import "tailwindcss/tailwind.css") shouldn't be importable in a layout component #21303
Labels
bug
Issue was opened via the bug report template.
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
14.15.4
What browser are you using?
Chrome Canary
What operating system are you using?
macOS Big Sur
How are you deploying your application?
Vercel
Describe the Bug
In the doc, it is said that "In Next.js, you can add global CSS files by importing them from pages/_app.js. You cannot import global CSS anywhere else."
With the "/styles/globals.css" this is indeed the case - it will emit an error. But I can import "tailwindcss/tailwind.css" in a
layout.js
component. Shouldn't "tailwindcss/tailwind.css" also be considered global CSS and only importable in_app.js
component?Expected Behavior
Emit an error when importing "tailwindcss/tailwind.css" in places other than
_app.js
.To Reproduce
Import "tailwindcss/tailwind.css" in any places.
_app.js
The text was updated successfully, but these errors were encountered: