Skip to content

Tailwind IntelliSense not recognizing utilities from imported package CSS in consuming project #1351

Closed
@LucetTin5

Description

@LucetTin5

What version of VS Code are you using?

For example: v1.96.2 (Cursor v0.49.6)

What version of Tailwind CSS IntelliSense are you using?

For example: v0.14.16

What version of Tailwind CSS are you using?

For example: v4.1.5

What package manager are you using?

For example: pnpm (v9)

What operating system are you using?

For example: macOS

Tailwind config

// Next.js app router (Next 15)
// app/globals.css
@import "tailwindcss";
@import "Package/styles.css"; 

VS Code settings

{
  "tailwindCSS.classFunctions": ["clsx", "cn", "cva"],
  "tailwindCSS.experimental.configFile": "./app/globals.css",
  "editor.quickSuggestions": {
    "strings": true
  },
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit",
    "source.organizeImports": "explicit"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "files.associations": {
    "*.css": "tailwindcss"
  }
}

Describe your issue

I'm building an internal design system as an npm package using Tailwind CSS v4.1.5.

The package includes a prebuilt styles.css generated by @tailwindcss/cli.
In the design system's worksapce, IntelliSence works correctly via the experimental.configFile setting pointed to the entrypoint CSS file.

However, after publishing the package and installing it into another Next.js (App Router) project, IntelliSense does not suggest the custom utilities defined in dist/styles.css.
Only the core Tailwind CSS utilities are shown, which makes sense since tailwindcss is still imported.

Is there a way to make IntelliSense recognize the utilities defined in the design system package?
Or is the only way to manually copy the full CSS configuration into the consuming project?

Next.js workspace
Image

With imported color variants, there should be some kind of text-primary-main.

Design System workspace
Image

Reproduction

You can find a minimal reproduction here:

https://github.com/LucetTin5/tw-intellisence-error

  • The fake-package is a local package with a styles.css using Tailwind CSS v4.1.5.
  • The consuming Next.js App Router project imports this file via app/globals.css.
  • IntelliSence does not pick up the custom utilities defined in fake-package/styles.css

The repo uses pnpm and is structured as a small monorep (pnpm-workspace.yaml) to siumlate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions