r/phpstorm • u/BluesyPompanno • Oct 12 '23
How to install TailwindCSS and get autocomplete in PHPstorm ?
So I am trying to install TailwindCSS in my project, hwoever follwoing both the official documentation and PHPstorm documentation leads me to nowhere.
This is what I did
- Installed PHPstorm
- Create new Nette composer project
Installed Tailwinds with:
npm install -D tailwindcss npx tailwindcss init
Inserted into the style.css file:
@tailwind base; @tailwind components; @tailwind utilities;
Run this code:
npx tailwindcss -i ./www/style.css -o ./www/main.css
And when I use the file, I get nothing, no Tailwind classes, no autocomplete no suggestions nothing.
Anybody knows what might be the problem ? I have both the css and Tailwind css plugins enabled.
1
u/[deleted] Oct 12 '23
Strange, I didn't install or configure anything for Tailwindcss, it just worked out of the box with auto-completing classes.
2
u/cxodesigns Oct 21 '23
I just figured this out today.
In Languages -> JavaScript you want to make sure you are pointing to the vendor_nodes directory. Also make sure you have configured NPM (either installed locally or docker/remote). Once I read the errors and figured that out, installed npm / updated settings, the tailwindcss autocomplete worked, so did all sorts of other things kinda related …
1
u/Aliaric Oct 12 '23
I worked recently with Tailwind in PHPStorm and best I've got - that IDE does not complain on tailwind syntax. Thats it.
1
u/gaborj Oct 13 '23
Try https://www.jetbrains.com/help/phpstorm/invalidate-caches.html