2

I have checked out many answers from Stack Overflow but I wasn't able to fix the issue that IntelliSense not working for Tailwindcss. But vscode Intellisense working for other things like python and javascript. Please anybody help me why this isn't working. I am using Tailwindcss Cli. even CSS file Intellisense also not working.

my config file is. tailwind.config.js

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

I also added this setting into .vscode/settings.json

{
"css.validate": false,
"liveServer.settings.port": 5501,
"tailwindCSS.emmetCompletions": true,
"tailwindCSS.includeLanguages": {
  "plaintext": "html",
  "javascript":"javascript"  
},
"editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
},
"tailwindCSS.classAttributes": [
    "class",
    "className",
    "ngClass"
]}

once a thing. CSS compiled successfully but Intellisense not working. and this is my project folder structure. please anybody help me, please.

folder structure of project

H Nazmul Hassan
  • 631
  • 2
  • 8
  • 17

8 Answers8

8

I think you almost got it... i added this to my settings and it worked.
what you are missing (in my opinion) is "inlineSuggest" - full snippet here:

"editor.quickSuggestions": {
   "strings": true
},
"css.validate": false,
"editor.inlineSuggest.enabled": true
H3AR7B3A7
  • 4,366
  • 2
  • 14
  • 37
Imri Sagive
  • 81
  • 1
  • 5
3

I found that intellisense for the extension will not work with single quotes. I had my ESLint config set to "jsx-quotes": ["warn", "prefer-single"]. If I use double quotes in my classNames, the intellisense works fine.

The solution for me was to update my settings.json to include "editor.quickSuggestions": { "strings": true }

1

Did you install the Tailwind CSS IntelliSense extension?

VS Code extension

A1exandr Belan
  • 4,442
  • 3
  • 26
  • 48
1

After trying every solution out there, the only thing that worked for me was to install the previous version of Tailwind CSS IntelliSense extension.

Dujveq E
  • 13
  • 3
1

My case was because I haven't updated my VSCode version. I knew the trouble because I checked on the Output Log > Tailwind CSS IntelliSense. You might need to check the log as well because the trouble can vary.

Here is the screenshoot of the output: enter image description here

1

In my case because I changed my user's name file in the past so VS Code has error 5 with auto-update. When I fix that error and updated lasted version, it work

Huy Tran
  • 11
  • 1
1

In my case it was the name of the parent folder.

I structure my folders like this: D:\[1] git and inside I have all the projects.

For some reason tailwind intellisense wouldn't initialize, even after I did everything already suggested.

But when I changed the parent folder to D:\git it worked.

So deleting the [1] from the path seemed to do the trick.

l3dger_0x
  • 23
  • 6
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 09 '23 at 13:20
1

If you have already installed the extension and had no luck with other answers, invalidate cache/remove node modules and yarn/npm your project again.

Kushal
  • 11
  • 2