Tailwind CSS IntelliSense support for theme variables defined via Uniwind @layer theme and @variant #394
Replies: 2 comments 5 replies
|
Hi, in the documentation for custom themes there's an example how to do this. You need to add your @variant colors to After your app is built we're recreating the uniwind.css file (@import "uniwind") with an empty variables so it is correctly working with tailwind intellisense
Sometimes the editor doesn't immediately pick up changes in css files that are inside node_modules, so it's worth trying reloading your IDE after adding a new css variable |
|
Sorry, when I gave the example, I did it incorrectly. I have it like this: However, when I place the cursor on bg-primary, I get:
Keep in mind that I need to have previously defined variables with the base colors that I will later use in the variants. That is why I cannot put the corresponding hex/ohcl color in the @variant, so I need to put it in :root beforehand so that the variable exists. |



Uh oh!
There was an error while loading. Please reload this page.
Hi Uniwind team 👋
I have a question regarding compatibility with the Tailwind CSS IntelliSense extension and theme variables defined using Uniwind’s
@layer themeand@variant.Specifically, I’m trying to define semantic color tokens like this:
This works correctly at runtime, but Tailwind CSS IntelliSense does not recognize utilities like:
as mapping to the defined color values.
My question is:
Is there a way to configure Uniwind so that Tailwind CSS IntelliSense recognizes these semantic colors? (it works without multiple themes by defining it in @theme)
For example, even if IntelliSense only resolves one default theme (e.g., light mode), it would already be extremely helpful if:
were recognized by IntelliSense.
The goal is to avoid duplicating color definitions in both:
@layer theme)tailwind.config.jsor similar)since that would introduce redundancy and potential inconsistencies.
Questions:
@layer themevariables planned?All reactions