meouwu-dev / css-var-color-decorator

View and edit css variables with color decorators
MIT License
7 stars 1 forks source link

Doesn't seem to do anything #2

Open tauren opened 10 months ago

tauren commented 10 months ago

@meouwu-dev This plugin looks like exactly what I need! But when I install it, I see no difference in my CSS file. The plugin is enabled in VSCode. Is there some activation or configuration that I need to make? How can I check if I'm hitting a bug?

My index.css file looks like this:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 20 14.3% 4.1%;

    --card: 0 0% 100%;
    --card-foreground: 20 14.3% 4.1%;

    --popover: 0 0% 100%;
    --popover-foreground: 20 14.3% 4.1%;

image

Edit: The hex2Hsl feature does appear to be working. But no existing HSL values have a color swatch shown in the file.

meouwu-dev commented 10 months ago

Hi, this extension should work once you have installed it.

By default it support language mode: css, scss, tailwindcss. Maybe vscode choose another language for your file. You can check it by clicking on the language mode in the bottom right corner of vscode.

I just published a new version(v1.2.0) that adds support for configuring the supported languages. If you want to add support for another language, you can add it in the settings. For example, if you want to add support for html, you can add it like this:

"cssVarColorDecorator.supportedLanguages": ["css", "scss", "tailwindcss", "html"]
Egnus commented 10 months ago

It does not work for me either with a clean install of svelte plus svelte-shadcn. The file from the basic installation src/app.pcss is still with no hint of the color, and I added all these to the settings:

"cssVarColorDecorator.supportedLanguages": [
    "css",
    "scss",
    "tailwindcss",
    "pcss",
    "html",
    "svelte"
  ]
tauren commented 10 months ago

I've updated the extension, but still no luck. Also tried switching the editor language mode (bottom right) from PostCSS to CSS, SCSS, etc. None work. I added the settings config with "postcss" in supportedLanguages, still no go.

tauren commented 10 months ago

I'm not sure what exactly changed, but its working for me now. I haven't restarted VSCode or anything. But I did clean up my project and removed a bunch of unused dependencies. Anyway, works great now, thanks!

pepper-mayo commented 9 months ago

I'm having the same issue, using shadcn. Have updated the supported languages.

SilentRhetoric commented 9 months ago

I found that VSCode was in "PostCSS" mode for some weird reason. Setting the language mode to CSS fixed the extension and it applies the color decorators now.

DanielSintimbrean commented 9 months ago

This works for me


  "cssVarColorDecorator.supportedLanguages": [
    "css",
    "scss",
    "tailwindcss",
    "postcss"
  ]