Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global CSS (import "tailwindcss/tailwind.css") shouldn't be importable in a layout component #21303

Closed
fnick851 opened this issue Jan 18, 2021 · 0 comments
Labels
bug Issue was opened via the bug report template.

Comments

@fnick851
Copy link

fnick851 commented Jan 18, 2021

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.

  1. Scaffold a next.js app
  2. Set up tailwindcss
  3. Import "tailwindcss/tailwind.css" in any component other than _app.js
@fnick851 fnick851 added the bug Issue was opened via the bug report template. label Jan 18, 2021
@vercel vercel locked and limited conversation to collaborators Dec 25, 2021
@balazsorban44 balazsorban44 converted this issue into discussion #32817 Dec 25, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant