Open justoverclockl opened 5 months ago
Hey @justoverclockl I checked your sandbox, issue is with your tailwind.config.ts
it is currently
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
},
plugins: [],
};
But There is no src
folder in your project,
Either Create src folder or update your tailwind.config.ts
file's content section to include app
folder instead.
Hope this will help your issue
if this is the issue, why tailwind classes are correctly applied?
@justoverclockl i forked your codesandbox and changed content of tailwind.config.ts
and it's working
https://codesandbox.io/p/devbox/competent-james-forked...
import globals.css will only reset the css,
but for applying the new css generated with classname you must need to add them in tailwind.config.ts
's content where it tailwind's transpiler generates css for that.
tailwindcss generates css on demand it does not loaded already like bootstrap 😊.
Thx I will try for sure!
@shriekdj not work at all, if i do your modification, tailwind is not loaded anymore.
@justoverclockl try moving root app
folder into src folder or change this part of tailwind.config.ts ./src/app/**/*.{js,ts,jsx,tsx,mdx}
to ./app/**/*.{js,ts,jsx,tsx,mdx}
Ran into the same issue when I created a src/features/
folder and had to add it in my Tailwind config because the default was:
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
Is there any reason why the default is not simply:
content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
?
@rwieruch because the template of nextjs with tailwindcss have the content already as per non src folder and for both src template and non src template they uses the same tailwind.config.js
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/competent-james-kzly2d
To Reproduce
1: visit the sandbox: https://codesandbox.io/p/devbox/competent-james-kzly2d 2: update route to: https://kzly2d-3000.csb.app/dashboard/scheduler 3: as you can see i have global.css that is loaded inside the main page and inside scheduler page, with yarn dev all works fine, but in production this css has no effect and is not loaded.
Current vs. Expected behavior
Actually css is not loaded, should be.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, App Router
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
No response