Skip to content

TypeScript config files not working in Intellisense via @config in v4 #1072

Closed
@ivodolenc

Description

@ivodolenc

What version of VS Code are you using?

  • 1.94.0

What version of Tailwind CSS IntelliSense are you using?

  • 0.13.45

What version of Tailwind CSS are you using?

  • 4.0.0-alpha.29

What package manager are you using?

  • pnpm

What operating system are you using?

  • macOS Sequoia 15.0.1

Current Behavior

Hi, intellisense doesn't work correctly in v4 for custom utilities even if they are specified via TypeScript config.

I read somewhere in the issues that custom classes do not provideautocompletion if they are specified via CSS API (via layer utilities {...} ), but classes that are specified via JavaScript Config API (config.plugins) should work normally.

Default Tailwind classes (theme API like flex, bg-white, space-x-1 etc.) work as expected with intellisense, but custom classes defined via TS configuration do not show up in autocomplete.

Here's a minimal reproduction:

// package.json

{
  "devDependencies": {
    "@tailwindcss/vite": "4.0.0-alpha.29",
    "tailwindcss": "4.0.0-alpha.29",
    // ...
  }
}
// .vscode/settings.json

{
  "editor.quickSuggestions": {
    "strings": true
  },
  "files.associations": {
    "*.css": "tailwindcss"
  },
  "tailwindCSS.experimental.configFile": "./src/styles/app.css"
}
/* src/styles/app.css */

@config "../../tailwind.config.ts";
@import 'tailwindcss';
// tailwind.config.ts

import plugin from 'tailwindcss/plugin'
import type { Config } from 'tailwindcss'

const config: Config = {
  content: [
    './src/app.html',
    './src/components/**/*.svelte',
    './src/content/**/*.md',
    './src/routes/**/*.{js,ts,svelte}',
    './src/styles/**/*.css',
  ],

  theme: {
    extend: {
      fontSize: {
        '3xs': '0.5rem', // 8px
        '2xs': '0.625rem', // 10px
      },
      spacing: {
        '4.5': '1.125rem', // 18px
        '5.5': '1.375rem', // 22px
      },
      // ...
    },
  },

  plugins: [
    plugin(({ addUtilities }) => {
      addUtilities({
        '.font-100': {
          'font-variation-settings': "'wght' 100",
        },
        '.font-150': {
          'font-variation-settings': "'wght' 150",
        },
        '.font-200': {
          'font-variation-settings': "'wght' 200",
        },
        // ...
      })
    }),
  ],
}

export default config

So, all the additional classes that I specified in the TS config (via theme.extend and plugins) do not show up in the autocompletion.

Expected Behavior

The expected behavior would be that everything works fine.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv4

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions