Skip to content

Tailwind CSS class detection false positives in TSX files #1405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nicolapps opened this issue Jun 7, 2025 · 4 comments
Closed

Tailwind CSS class detection false positives in TSX files #1405

Nicolapps opened this issue Jun 7, 2025 · 4 comments

Comments

@Nicolapps
Copy link

What version of VS Code are you using?

Cursor 1.0.0 (based on VS Code 1.96.2)

What version of Tailwind CSS IntelliSense are you using?

For example: v0.7.0

What version of Tailwind CSS are you using?

4.0.14

What package manager are you using?

npm

What operating system are you using?

macOS 15.5

Tailwind config

@import "tailwindcss";

This bug happens with default Tailwind CSS settings.

VS Code settings

{}

This bug happens with default VS Code settings.

Reproduction URL

https://github.com/Nicolapps/repro-tailwindcss-intellisense-static/blob/main/src/repro.tsx

Describe your issue

The following patterns are mistakenly detected as Tailwind CSS classnames:

  • the static JavaScript keyword
  • JavaScript variables names where declared
  • TypeScript type and interface names (both when declared and used)
Image
@thecrypticace
Copy link
Contributor

You did not include your VSCode settings but this is likely a problem with your custom class regex. You should use the array form of patterns where it defines separate "container" and "class list" patterns. See my comment here #1174 (comment) about a similar issue where things were being picked up / detected when they shouldn't be and how to solve it.

@Nicolapps
Copy link
Author

Hi @thecrypticace,

Thank you for your reply. My issue can be reproduced without any custom settings (I specifically set my VS Code settings to {} to verify that the issue isn’t caused by custom settings I have). In particular, I’m not using tailwindCSS.experimental.classRegex.

@thecrypticace
Copy link
Contributor

@Nicolapps ooh I just noticed the /* layer: default */ comment. We don't have those. My guess is that hover isn't coming from IntelliSense at all. This is probably another extension you have installed picking up compiled CSS.

@Nicolapps
Copy link
Author

@thecrypticace Oops, you’re right! I ran an extension bisect and it turns out that the issue is caused by the UnoCSS VS Code extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants