-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Put full colors in CSS variables #215
Comments
@multiwebinc This is how Tailwind does CSS variables. See https://tailwindcss.com/docs/customizing-colors#using-css-variables See also my comment here: https://github.com/shadcn/ui/issues/199#issuecomment-1513596747 |
Ok, I read the docs more in detail and I understand why they do it like that. It's because of the Let me know if you would be interested in a PR. |
I understand the design decision given the options, but currently this makes shadcn unusable for me. I need to see the colors in VsCode more than the time saved with darkmode handling. Is there a good workaround? |
Same issue in Webstorm. Having to deal with hsl values is a real pain 😕. |
Agree with @multiwebinc on adding the |
Just stumbled onto this pain point and wanted to +1 the notion of working towards a more robust solution |
I also agree with building a more robust solution which provides better developer experience. Not being able to visualize colors while applying them is a very big pain point. |
any update on this ? |
Hi everyone, This is the first time I write a vscode extension, so there may be some bugs. https://marketplace.visualstudio.com/items?itemName=meouwu.css-var-color-decorator |
@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 @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%; |
Same here, nothing happens in my CSS file |
@benyamynbrkyc i add this in my .vscode/settings.json "cssVarColorDecorator.supportedLanguages": ["css", "scss", "tailwindcss", "html"], and it works |
I love you bro |
Tried it, still nothing :( |
Not working for me either, looks like a fantastic solution though. |
@benyamynbrkyc @tauren I found what was causing it not to work for me... The PostCSS Language Support extension (csstools.postcss) was blocking it, if you have that installed try disabling it. |
Any extension like for this Webstorm? |
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you. |
Any plugin like for this Neovim? |
I'm not sure if there is a reasoning behind the current way, but why do we have:
And then:
This way VSCode doesn't give you a color preview in the CSS file (probably other editors as well).
Wouldn't it be better to do:
And then:
That way we get a preview of the color and a color picker in VSCode like this beside
--primary
:The text was updated successfully, but these errors were encountered: