Vscode tailwindcss intellisense not working #11530
-
What version of VS Code are you using? Version: 1.63.0 What version of Tailwind CSS IntelliSense are you using? Version: 0.8.6 What version of Tailwind CSS are you using? Version: 3.3.2 What package manager are you using? What operating system are you using? Tailwind config import type { Config } from 'tailwindcss'
import defaultTheme from 'tailwindcss/defaultTheme.js'
import animatePlugin from 'tailwindcss-animate'
import radixPlugin from 'tailwindcss-radix'
export default {
content: ['./app/**/*.{ts,tsx,jsx,js}'],
darkMode: 'class',
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: {
DEFAULT: 'hsl(var(--input))',
invalid: 'hsl(var(--input-invalid))',
},
ring: {
DEFAULT: 'hsl(var(--ring))',
invalid: 'hsl(var(--foreground-danger))',
},
background: 'hsl(var(--background))',
foreground: {
DEFAULT: 'hsl(var(--foreground))',
danger: 'hsl(var(--foreground-danger))',
},
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
fontFamily: {
sans: ['var(--font-sans)', ...defaultTheme.fontFamily.sans],
},
fontSize: {
// 1rem = 16px
/** 80px size / 84px high / bold */
mega: ['5rem', { lineHeight: '5.25rem', fontWeight: '700' }],
/** 56px size / 62px high / bold */
h1: ['3.5rem', { lineHeight: '3.875rem', fontWeight: '700' }],
/** 40px size / 48px high / bold */
h2: ['2.5rem', { lineHeight: '3rem', fontWeight: '700' }],
/** 32px size / 36px high / bold */
h3: ['2rem', { lineHeight: '2.25rem', fontWeight: '700' }],
/** 28px size / 36px high / bold */
h4: ['1.75rem', { lineHeight: '2.25rem', fontWeight: '700' }],
/** 24px size / 32px high / bold */
h5: ['1.5rem', { lineHeight: '2rem', fontWeight: '700' }],
/** 16px size / 20px high / bold */
h6: ['1rem', { lineHeight: '1.25rem', fontWeight: '700' }],
/** 32px size / 36px high / normal */
'body-2xl': ['2rem', { lineHeight: '2.25rem' }],
/** 28px size / 36px high / normal */
'body-xl': ['1.75rem', { lineHeight: '2.25rem' }],
/** 24px size / 32px high / normal */
'body-lg': ['1.5rem', { lineHeight: '2rem' }],
/** 20px size / 28px high / normal */
'body-md': ['1.25rem', { lineHeight: '1.75rem' }],
/** 16px size / 20px high / normal */
'body-sm': ['1rem', { lineHeight: '1.25rem' }],
/** 14px size / 18px high / normal */
'body-xs': ['0.875rem', { lineHeight: '1.125rem' }],
/** 12px size / 16px high / normal */
'body-2xs': ['0.75rem', { lineHeight: '1rem' }],
/** 18px size / 24px high / semibold */
caption: ['1.125rem', { lineHeight: '1.5rem', fontWeight: '600' }],
/** 12px size / 16px high / bold */
button: ['0.75rem', { lineHeight: '1rem', fontWeight: '700' }],
},
keyframes: {
'accordion-down': {
from: { height: '0' },
to: { height: 'var(--radix-accordion-content-height)' },
},
'accordion-up': {
from: { height: 'var(--radix-accordion-content-height)' },
to: { height: '0' },
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
},
},
},
plugins: [animatePlugin, radixPlugin],
} satisfies Config VS Code settings {
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"security.workspace.trust.untrustedFiles": "open",
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"window.zoomLevel": 1,
"editor.formatOnSave": true,
"files.associations": {
"*.css": "tailwindcss"
},
"editor.quickSuggestions": {
"strings": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
} Describe your issue The Tailwindcss intellisense is not working in my project. I suspect the problem is the tailwind config file, currently my config file is written in typescript whereas the extension supports config file in javascript. In case I change the config file to javascript the intellisense starts working. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey @Amrender-Singh, this is most likely because you're using an old version of the extension. If you upgrade to the latest version you should be good to go 👍 |
Beta Was this translation helpful? Give feedback.
-
I can confirm it is working fine with latest version. Thanks |
Beta Was this translation helpful? Give feedback.
-
I have face same error, can everyone help me? |
Beta Was this translation helpful? Give feedback.
Hey @Amrender-Singh, this is most likely because you're using an old version of the extension. If you upgrade to the latest version you should be good to go 👍