2

I have a problem. I'm learning laravel 8 and tailwind CSS. and as title vscode tailwind CSS Intellisense not working. My tailwind CSS version is 2.2.15. tailwind.config.js like the photo. enter image description here output no error enter image description here

so what can I do about this issue?

3
  • Have you added the Tailwind Css IntelliSense plugin to VSCode? Occasionally, mine will stop working so I have to disable / re-enable the plugin. Commented Sep 25, 2021 at 16:29
  • Yes,I try sublime and phpstorm ,sublime is work. phpstorm doesn't. Commented Sep 26, 2021 at 6:14
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 3, 2021 at 12:45

5 Answers 5

12

Tailwind CSS IntelliSense extension doesn't work until you have a configuration file in your workspace, as its description clearly states!

You'll be fine even if you're just using the CDN, but you have to create a tailwind.config.js file in your project's root directory, containing the defaults at least:

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

Also, and since you're working with Laravel, I guess you need to add Blade files to be recognized by the extension through this VSC setting (in settings.json):

"tailwindCSS.includeLanguages": {
    "blade": "html",
},

Moreover, this extension can offer intellisense in CSS files. So such files need to be binded too:

"files.associations": {
    "*.css": "tailwindcss",
},

One final note: The content paths are what going to be processed by Tailwind's JIT engine; understanding it is crucial!

Update: In my current setup, it also won't work until I run the project folder as a "VSC workspace".

Sign up to request clarification or add additional context in comments.

1 Comment

I face the same problem with php file. After adding tailwind.config.js file in the root directory, problem is solved.
0

Possible Solution

Disable a single VS Code Extension called: "Bootstrap 4, Font awesome 4, Font Awesome 5 Free & Pro snippets"

Evidence

Tailwind CSS IntelliSense was not working in my Angular project. I had installed Tailwind CSS using their instructions:

Click here

MY VERSIONS

  • VS Code: 1.62.3
  • Tailwind CSS: 3.0.1
  • Angular: 13.0.3

I disabled the extension, mentioned as my "Possible Solution" above, and Tailwind CSS IntelliSense worked instantly.

Demo of Tailwinds CSS IntelliSense in my Angular project

Comments

0

i had same the issue while working on tailwind with laravel.
unInstalling and reinstalling tailwind intellisense extension solved my problem.
also , dont forget to add the following in the part of your blade file :

<link href="{{ asset('css/app.css') }}" rel="stylesheet">

Comments

0

For me, it seems to be an issue with one of my extensions.

I needed to uninstall the "Emmet Live" extension and install the "Mithril Emmet" extension.

As some other answers have suggested, make sure you also put the following in your settings.json:

"tailwindCSS.emmetCompletions": true,
  "editor.inlineSuggest.enabled": true,
  "editor.quickSuggestions": {
    "strings": true
  },
"css.validate": false

Comments

-1

Using '' instead of "" might work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.