'How to solve CSS intellisense for VSCode not working?
Well, this is embarrassing, basically, the CSS Intellisense stopped working out of the blank, not sure if I can relate it with the installation of TailWind Intelissense extension, interestingly it works on SCSS files, but if I try it in a vanilla HTML + CSS project it does not work. I am using Fedora 35. I already tried restarting the editor as recommended on the official website.
Solution 1:[1]
I know this is a little late for the answer, but I had the same issue when using tailwind.
Given that you are using tailwind, most likely there is a chance you are using postcss
, which you can confirm by checking postcss.config
file.
If that is the case, then install the postcss vscode extension, and follow the instructions:
- Open the command palette and select Preferences: Open Settings (JSON)
- Add the following configuration:
{
"emmet.includeLanguages": {
"postcss": "css"
}
}
This should fix your css autocomplete, it is what worked for me.
Solution 2:[2]
When I'm using a basic style.css
file, even after adding "postcss": "css"
in "emmet.includeLanguages":{}
CSS Intellisense still doesn't work.
Disabling the postcss VSCode extension allows CSS Intellisense to work properly for me.
Solution 3:[3]
Here's what the official website says if IntelliSense isn't working:
Troubleshooting #
If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.
…
A particular language extension may not support all the VS Code IntelliSense features. Review the extension's README to find out what is supported. If you think there are issues with a language extension, you can usually find the issue repository for an extension through the VS Code Marketplace. Navigate to the extension's Details page and select the Support link.
You should probably try:
- Disabling any extensions that may be related to the issue. You mention that it may have to do with the TailWind Extension; try disabling or uninstalling that and see if the intellisense starts up again.
- Restarting the editor again.
- Filing an issue on their GitHub page if it's still not working.
Solution 4:[4]
I had the same issue. So, I solved it by adding
"files.associations": {
"*.css": "css",
"css": "css"
}
to my my settings.json file. Don't know is it is going to help you, but anyway. Good luck!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | lanxion |
Solution 2 | Zach Jensz |
Solution 3 | |
Solution 4 |