windicss-intellisense icon indicating copy to clipboard operation
windicss-intellisense copied to clipboard

is not valid windi css class

Open lucpotage opened this issue 3 years ago • 13 comments

Hi,

Thanks for making and maintaining Windi CSS. I got the following error when hovering my bg-neutral-lighter class:

bg-neutral-lighter is not valid windi css class (windi_invalid-class)

In my configuration file, I put

export default defineConfig({
  theme: {
    colors: {
      neutral: {
        dark: 'var(--ms-gray-800)',
        DEFAULT: 'var(--ms-gray-500)',
        light: 'var(--ms-gray-100)',
        lighter: 'var(--ms-gray-50)'
      },
    },
  },
})

Do you see any reason that leads my class not to be taken into account? Is it because I use CSS variables? If so, any workaround I could use?

lucpotage avatar Dec 17 '21 17:12 lucpotage

I think the config is not picked up correctly somehow. I will try to look at it next week

alexanderniebuhr avatar Dec 18 '21 14:12 alexanderniebuhr

Is there an update on this?

alvinindra avatar Jan 18 '22 09:01 alvinindra

I have the same problem.

lvyunlong avatar Jan 26 '22 11:01 lvyunlong

I've just checked the config loader. It does not show any issue so far. Can anyone share an repo for me to test, where this issue happens?

alexanderniebuhr avatar Feb 02 '22 08:02 alexanderniebuhr

I've just checked the config loader. It does not show any issue so far. Can anyone share an repo for me to test, where this issue happens?

It happens when the config is change. But when I restart the VS Code it not show error.

alvinindra avatar Feb 02 '22 09:02 alvinindra

I'm also facing a similar issue, so when I'm adding a new color to the config, it's not detected but after restarting the vscode it works fine. It's kinda annoying 😅

giteshk01 avatar Feb 22 '22 14:02 giteshk01

I'm also facing a similar issue, so when I'm adding a new color to the config, it's not detected but after restarting the vscode it works fine. It's kinda annoying 😅

Same

MJEND7 avatar May 03 '22 00:05 MJEND7

I am having the same issue but at all times. It does not get fixed by restarting VS Code. I have to add that windiCSS works just fine and my colors are displayed correctly. Any update is welcome, thanks.

ghost avatar May 09 '22 16:05 ghost

+1 same image

leosin avatar May 22 '22 07:05 leosin

Any updates on the issue?

velvetcode206 avatar Jun 30 '22 19:06 velvetcode206

contribution welcome, otherwise we suffer maintainers

alexanderniebuhr avatar Jul 01 '22 05:07 alexanderniebuhr

I think the simplest thing to do would be to add a setting for the project to define the configuration file path manually.

wyrd-code avatar Jul 23 '22 21:07 wyrd-code

I don't think this issue is reproducible because it is environment and incident dependent. Anyway, apparently Windicss extension on VSCode switches language that renders .css files, for me it switched to PostCSS so i just changed it Windi and it worked. image

qundus avatar Aug 06 '22 19:08 qundus