Skip to content
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

Color palette incorrect when using custom properties #415

Closed
maxsalven opened this issue Sep 22, 2021 · 2 comments
Closed

Color palette incorrect when using custom properties #415

maxsalven opened this issue Sep 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@maxsalven
Copy link

My colors are all defined using css custom properties, which means the color palette preview is incorrect.

It would be great if we could point the extension at a .css file where these properties are defined.

Screen Shot 2021-09-22 at 5 11 35 PM

in tailwind.config.js:

    colors: {
      red: {
        "50": "var(--color-red-50)",
        "100": "var(--color-red-100)",
        "200": "var(--color-red-200)",
        "300": "var(--color-red-300)",
        "400": "var(--color-red-400)",
        "500": "var(--color-red-500)",
        "600": "var(--color-red-600)",
        "700": "var(--color-red-700)",
        "800": "var(--color-red-800)",
        "900": "var(--color-red-900)",
      },
    }

in app.css:

:root {
  --color-red-50: #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-200: #fecaca;
  --color-red-300: #fca5a5;
  --color-red-400: #f87171;
  --color-red-500: #ef4444;
  --color-red-600: #dc2626;
  --color-red-700: #b91c1c;
  --color-red-800: #991b1b;
  --color-red-900: #7f1d1d;
}
@bradlc bradlc added the bug Something isn't working label Sep 24, 2021
@marcoSven
Copy link

marcoSven commented Sep 25, 2021

It would be great if we could point the extension at a .css file

I don't think this is necessary, what I do is use fallback values

colors: {
      red: {
        "50": "var(--color-red-50, #fef2f2)",
      },
    }

@bradlc
Copy link
Contributor

bradlc commented Sep 29, 2021

Hey @maxsalven. It's out of scope for the extension to attempt to resolve the actual values, but the issue with your variables all resolving to "red" is fixed in 0.6.15 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants