Skip to content

[intellisense]: IntelliSense hides utility if name matches custom variant #1355

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
programming-with-ia opened this issue May 9, 2025 · 4 comments
Assignees

Comments

@programming-with-ia
Copy link

Describe your issue

When I define a custom utility and a custom variant with the same name, IntelliSense in VSCode only shows the variant — the utility is missing from suggestions.

Tailwind generates the utility class correctly in the final CSS output. This is only a VSCode IntelliSense issue.

What version of Tailwind CSS are you using?

tailwind: v4.0.15
windows: 11
vscode: latest
Tailwind CSS IntelliSense: latest

Example

@custom-variant mica (&.mica);

@layer utilities {
 
  .mica {
    @apply bg-background
  }
}
@RobinMalfait RobinMalfait transferred this issue from tailwindlabs/tailwindcss May 9, 2025
@RobinMalfait RobinMalfait self-assigned this May 9, 2025
@wongjn
Copy link

wongjn commented May 9, 2025

You can try registering the class name with @utility for Tailwind to know about it:

 @custom-variant mica (&.mica);

-@layer utilities {
-  .mica {
+@utility mica {
   @apply bg-background
 }
-}

@RobinMalfait
Copy link
Member

Hey!

The intellisense plugin will only match actual utilities and variants. The .mica class in the utilities layer is considered normal user CSS, not a utility.

If you want it to be a utility, you have to use the @utility directive. More info: https://tailwindcss.com/docs/upgrade-guide#adding-custom-utilities

@programming-with-ia
Copy link
Author

theme format issue ☺️

Image

@thecrypticace
Copy link
Contributor

thecrypticace commented May 10, 2025

The syntax highlighting is something I'm working on fixing. Spent some time on it yesterday and hoping I don't have to copy the entire CSS theme from CSCode but not sure yet. Was hoping it was going to get proper nesting support by now but it has not so it'll take some work to do so.

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

4 participants