Repository navigation
Replies: 3 comments 1 reply
|
Hello @Plovst |
|
Related: What's breaking changes from v4? Comply with the new import stepsFrom v4 onwards, the plugin looks for the additional
@import "tailwindcss";
@layer base {
/* ... */
}
If you want to split it into multiple parts, this shorthand means the following: @layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);
@layer base {
/* ... */
}ConfigurationFrom version 4 onwards, the legacy JS-based configuration is no longer available by default. I recommend checking out the CSS-first configuration, which is the primarily recommended approach and provides configuration options directly from a CSS file.
If you still want to use the JS configuration, you need to specify its relative path with the @import "tailwindcss";
@config "../../tailwind.config.js";
@layer base {
/* ... */
}Tailwind CSS IntelliSense
|
|
Your CSS entry is the main problem — it's written for v3. In v4 there are no @import "tailwindcss";As written, that import fails, so the CSS never compiles — and with nothing compiled, the language server has nothing to serve suggestions from. That's the "completely dead" IntelliSense you're seeing. Then the JS config: v4 does not auto-load @import "tailwindcss";
@config "../tailwind.config.js";(Or move the theme customisation into CSS with Two more things to check once the import is fixed:
Fix the import first — in most of these upgrade cases that alone brings suggestions back. |
Uh oh!
There was an error while loading. Please reload this page.
I'm having an issue with Intellisense no longer working after upgrading to V4. I can see others have issues with this, since the tailwind.config.js is no longer mandatory. In this case I'm still using it though, since it's a Wordpress setup and I'm using values from theme.json in my config.
Amongst other things, I've tried manually pointing to the config file like this, but it doesn't work:
My tailwind.config.js looks like this:
Tailwind.css looks like this:
Any obvious errors I'm not seeing?
All reactions