The transition to v4 is broken... #18711
-
Hello everyone! I'm using Tailwind CSS for a Laravel/Vuejs project, and my upgrade to v4 doesn't seem to be working: The variables in app.css aren't being generated, and I don't understand what's causing the problem. My tailwind.config.js file looks like this: @import "tailwindcss";
body,
html {
--font-sans:
'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--border:214.3 31.8% 91.4%;
...
}
.dark {
...
--background:222.2 84% 4.9%;
--foreground:210 40% 98%;
--border:217.2 32.6% 17.5%;
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
} And tailwind.config.js :
It seems that tailwind.config.js is not loaded to get the colors? And so I have a black and white app... My vite.config.ts have a
But, I did Tks ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
From v4 onwards, we no longer use the tailwind.config.js file. Instead, we have switched to CSS-first configuration by default. Useful links:
content
property no longer needed:@tailwind
directives deprecated:Avoid
@apply
: