-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[colorManipulator] Defining a css theme variable with rgb() and var() not working #37901
Comments
@maxdacruz I'm not sure this is supported 🤔 I can reproduce it locally, and it looks like the main color ( |
What's odd is that the palette seems to generating correctly even if you only give it 1 hex token (example sandbox) We have a docs update here that says for custom colors all the tokens should be provided, the same Maybe @DiegoAndai and @siriwatknp are more familiar with this ~ |
Hey @maxdacruz, thanks for the report! Providing CSS variables as the ![]() But you managed to bypass it by providing In the provided example the WorkaroundIf you provide the colors as Hopefully, that's a workaround that works for you and your team 😊 Otherwise, or if you have any more questions, let me know Enhancement (Ready to take)We should improve the pattern checking to catch cases like this in this error. I'll mark this enhancement as ready to take. |
changing the conditional statement to check if the color includes |
In the near future, I believe that we will replace all of the JS color manipulation with |
Steps to reproduce 🕹
Link to live example:
https://codesandbox.io/s/wizardly-lamarr-6cnsfz?file=/src/MainTheme.ts
If I define a css variable in the theme with rgb and var keywords, the theme applies the main color correctly but doesn't generate automatically the others like where if I define a hex color it works as intended.
Current behavior 😯
The button with variant outlier has no border
Expected behavior 🤔
The button border should be using the primary color defined in the theme
Context 🔦
I'm trying to use our custom colors defined as rgb separated by commas that are being used in other internal libraries with mui's new css theme variables support
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: