-
-
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
Custom Button variant with custom color doesn't work #30588
Comments
Please provide a CodeSandbox (https://material-ui.com/r/issue-template-latest), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve |
|
The background color is set if the variant is |
@mnajdova could you show me example how to add it myself? I would understand as I would need to do something like this:
|
@slaby93 you can make the
|
@mnajdova
Which, depending on selected "color" props, gives me different output. If you know how to do it better, I'm all ears, but this is good enough for now :) Thanks for the support. Quick q: If I do have right now selected color fqRed but I just have main and contrastText, I found in docs that I should be able to use "dark" and "light" variations that should be calculated by MUI. How to access those? Now:
|
Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. |
Duplicates
Latest version
Current behavior 😯
I do create custom theme like this:
Then I do render them like this:

This is the outcome:

Interestingly enough, it does work with Typography but does not with Button component.
Expected behavior 🤔
I expect that when I provide custom color for custom variant it does work.

It works for default variant like contained or outline, but when I do create variant, it doesn't
Steps to reproduce 🕹
Steps:
Context 🔦
I want to have custom variant that specify how does component looks ( shape ) and custom color that applies colors.
Your environment 🌎
`npx @mui/envinfo`
UPDATE
Link to reproduce error: https://codesandbox.io/s/cold-rgb-gzjzt?file=/src/Demo.tsx
The text was updated successfully, but these errors were encountered: