Tailwind autocomplete in vscode

(being a bit lazy here)

How do I configure vscode to have support for tailwind?
Can I also tell it I’m using daisy?

I can get it to work if I add .res to tailwinds file configuration. I believe you can also set this in the tailwind extension’s settings.

Are you using v4? If so, how does your file look like?

I’m on V3. I’m using Fresh and they haven’t updated yet, or at least it didn’t do it for me when I ran the upgrade command. I looked at switched to V4 but I had to manually compile.

Here’s my V3 config if that helps: plex-movie-night/tailwind.config.ts at main · jderochervlk/plex-movie-night · GitHub

I think this is the v4 equivalent: Detecting classes in source files - Core concepts - Tailwind CSS

I don’t really think that is related to the intellisense part of Tailwind.
That seems more about how Tailwind figures out which classes you use.

@fham any thoughts here?

There’s also a way to maybe set it in the extension settings.

I just ran create rescript-app and then npx @tailwindcss/upgrade and autocomplete and the color boxes show up for me without any additional config.d Nothing set for vscode to look for classnames and no changes to the config from the default. This is with postcss. Even if I delete the post css config file it still works, even after restarting vscode.

AFAIK tailwind 4 does not use postccs anymore?
And ReScript is in fact a built-in language: tailwindcss-intellisense/packages/tailwindcss-language-service/src/util/languages.ts at main · tailwindlabs/tailwindcss-intellisense · GitHub

The autocomplete works for me in a className="" string. However, when I do this:

let style = ""
<div className=style /> 

the autocomplete does not work in the style string, it needs to be named className.

1 Like

v4 does support postcss: Installing Tailwind CSS with PostCSS - Tailwind CSS

Okay, weird, last time I tried that it didn’t work for me.
Today, it was just as you said.

1 Like

Apologies! It merely does not require to configure postcss-import anymore.