Reputation: 395
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.
Upvotes: 17
Views: 34157
Reputation: 1430
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.
Upvotes: 7
Reputation: 61
It seems this is still an issue when using the extension PostCSS Language Support.
Solved by uninstalling that extension and replacing with PostCSS Intellisense and Highlighting.
Upvotes: 6
Reputation: 1
Try changing your editor from "ui" to "json" in the settings. (File->Preferences->Settings). Then you may have to use the toggle icon if your current display is the json file. (My icon at the upper right of the screen says "Open Settings"). I am using version 1.87.2 so yours might say something different.
Choose the Settings editor under the Workbench option (or type "workbench.settings.editor" in the search bar) and you can change it from 'ui' to 'json'. Once I changed it, my intellisense starting working again.
Upvotes: 0
Reputation: 1
I disabled the extension -> "PostCSS Language Support". That fixed the bug
Upvotes: 0
Reputation: 41
-Open VSCode
-Click Code in the toolbar
-Go to Settings>>Settings
-Click Text Editor to open the dropdown
-Click Files
-Under Associations enter *.css
for the "Item" column and enter css
for the "Value" column
-Repeat this with "Item" css
"Value" css
Upvotes: 4
Reputation: 13
Like @timbhison mentioned, I just checked my file type and changed it to "CSS" instead of "CSS liquid" and this solved my problem. Adding the below code didn't have any effect.
{
"emmet.includeLanguages": {
"postcss": "css"
}
}
Upvotes: 0
Reputation: 1029
Follow these steps:
Upvotes: 2
Reputation: 17462
I have installed this extension in vs code. CSS
, HTML
and Bootstrap
intelligence showing up.
IntelliSense for CSS class names in HTML
Upvotes: 2
Reputation: 171
I came to this question having a similar issue and found I just needed to manually change the language mode in the bottom right to CSS rather than Post-CSS. Obvious in hindsight, but just recording here in case anyone hasn't tried it.
Upvotes: 0
Reputation: 311
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!
Upvotes: 31
Reputation: 101
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.
Upvotes: 10
Reputation: 1835
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:
Upvotes: 0