Skip to content
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

Tailwind CSS IntelliSense extension stopped working #165

Open
luuktimmermans opened this issue Feb 6, 2025 · 7 comments
Open

Tailwind CSS IntelliSense extension stopped working #165

luuktimmermans opened this issue Feb 6, 2025 · 7 comments

Comments

@luuktimmermans
Copy link

Hi,

I've been using the updated _tw theme with Tailwind v4, but since I've been using this, the Tailwind CSS IntelliSense extension stopped working. Does anybody else have this same issue?

Best regards,

Luuk

@luuktimmermans
Copy link
Author

Okay, I managed to find a workaround.

I use ./tailwind/tailwind.css which includes all tailwind stuff, from plugins to utilities to layers. I added the following snippet to the settings.json file in my .vscode folder:

"tailwindCSS.experimental.configFile": "./tailwind/tailwind.css"

I'm curious if somebody comes up with a better solution!

@gregsullivan
Copy link
Owner

Hi Luuk—Thank you for this!

I had seen comments about issues with Tailwind IntelliSense in projects with similar structures to this one, but I hadn't had time to investigate more deeply.

Given the dominance of VS Code, I may start by including a ./.vscode/settings.json file by default with this entry. I'm fairly confident your solution is the best one, pending the configFile setting losing its experimental status.

If it were up to me, they would add a key to package.json indicating the Tailwind config file so that other editors could also use it. It appears users of PhpStorm will also encounter this issue, needing to set the same value in a different place.

@gregsullivan
Copy link
Owner

I've thought about this some more, and I think what may make sense is moving ./tailwind/tailwind.css to ./tailwind.css, with the corresponding path changes. That triggers detection without settings changes, which strikes me as cleaner than documenting setting configFile across different IDEs.

@luuktimmermans
Copy link
Author

luuktimmermans commented Feb 11, 2025

Can you confirm that this works?

I found another issue, class sorting using the Prettier doesn’t seem to work. What am I missing here?

@gregsullivan
Copy link
Owner

I can definitely confirm that it works, though two changes are required: Changing the paths and updating package.json. I'm going to try and deploy that change today.

Where are you looking for class sorting? PHP or CSS?

@luuktimmermans
Copy link
Author

Alright, great!

I’d like class sorting to work in both file types.

@gregsullivan
Copy link
Owner

Class sorting in CSS should be working, but if it's not for you, please let me know!

Class sorting in PHP is not possible right now. Please see:

https://underscoretw.com/release-notes/january-2025/#h-tailwind-class-name-ordering-in-php-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants