TailwindCSS autocompletion in PhpStorm not working
Asked Answered
B

8

7

I just updated PhpStorm to version 2020.3 which now supports autocompletion for Tailwind CSS. But in my new updated version it isn't working and can't figure out why.

In html, blade and css files, there is no autocompletion for Tailwind CSS.

Do I have this enable somewhere? Why isn't it working?

Ballade answered 4/12, 2020 at 10:0 Comment(1)
Check original ticket for possible requirements etc: youtrack.jetbrains.com/issue/WEB-42792 . The way how TailwindCSS package is installed / used Tailwind version may affect this. Check the ticket comments and look at related tickets. Other tickets (so you may browse through them): youtrack.jetbrains.com/issues/WEB?q=tailwind . blog.jetbrains.com/webstorm/2020/11/webstorm-2020-3-eap-7/…Larynx
B
6

Looks like there is an bug when using npm installer and when you are using version npm:@tailwindcss/postcss7-compat@^2.0.1 of tailwind.

source https://youtrack.jetbrains.com/issue/WEB-48473

My solution: delete node_modules and use yarn install

Ballade answered 4/12, 2020 at 12:41 Comment(1)
Lol, still working on 2022.3.1... Thanks mate! Just run npm i npm:@tailwindcss/postcss7-compat@^2.0.1 I'm using tailwind 3Dugaid
P
7

I solved by downloading the tailwindcss library.

setting

download

Progression answered 11/7, 2022 at 7:13 Comment(0)
B
6

Looks like there is an bug when using npm installer and when you are using version npm:@tailwindcss/postcss7-compat@^2.0.1 of tailwind.

source https://youtrack.jetbrains.com/issue/WEB-48473

My solution: delete node_modules and use yarn install

Ballade answered 4/12, 2020 at 12:41 Comment(1)
Lol, still working on 2022.3.1... Thanks mate! Just run npm i npm:@tailwindcss/postcss7-compat@^2.0.1 I'm using tailwind 3Dugaid
P
4

Just had this issue with a new Vue project, solved it by going to:

Settings -> Languages & Frameworks -> Style Sheets -> Tailwind CSS

And adding the following to the "includeLanguages" section:

      "scss": "scss",
      "html": "html",
      "javascript": "javascript",
      "typescript": "typescript",
      "css": "css",
      "vue": "vue",
      "sass": "sass",
      "twig": "twig"

Seems like it doesnt include all files and languages by default.

Paver answered 1/3, 2024 at 14:25 Comment(3)
Confirmed working in Webstorm 2024.1 - thanksMassimiliano
I needed to add "twig": "twig"Wenger
@Wenger I added it in, thanks.Paver
C
3

if you are using a node version manager check that your project Language & Frameworks configuration for Node.js and NPM is actually using the same node version where you installed tailwind and postCSS packages

Carrillo answered 7/3, 2021 at 5:12 Comment(1)
Any tips on how to do this? I am so new to tailwinds and only really do PHPWilburwilburn
C
2

To fix the problem, update to version 2021.3.1. Do not look for another solution because it does not exist enter image description here

Condensate answered 2/2, 2022 at 7:55 Comment(1)
I had an issue with 2021.3.1 but after upgrade to PhpStorm 2021.3.2 works fine.Doublethink
T
1

Just had the same problem with 2023.1.1 in a javascript project, seems to be an reoccuring problem. Nothing helped, not reinstalling tailwindcss or removing .idea. I couldnt even update the IDE because of its bugged update feature. Had to uninstall it and download the new version 2023.1.4, then it worked.

Transfix answered 22/7, 2023 at 17:26 Comment(1)
It's a joke how it works then doesn't work then works without any changes again. Maybe it is on a tea break or popped out for a cigarette?Slype
A
1

I solved the problem by select the node_module folder in libraries configuration :

phpstorm config selection in order to make libs (including tailwind) in node_modules folder used by plugins

Asymmetric answered 6/10, 2023 at 5:32 Comment(0)
A
0

For anyone still struggling with this issue and hasn't figured out why, the problem is that PhpStorm enters power saving mode. You need to disable it, and then everything will start working again. I discovered this after many hours of troubleshooting.

Appurtenant answered 8/8, 2024 at 19:9 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.