-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[theme] How to customize a specific state in theme.components.stylesOverrides? #25214
Comments
@danielmulvad This is simply not supported. We might try to remove all mentions from things like styleOverrides: {
outlinedSecondary: { in the documentation (only supporting |
Ok, to be more comprehensive for the future developers and designers reading this. There are two possible solutions:
styleOverrides: {
root: {
borderRadius: ".25rem",
minHeight: "40px",
minWidth: "min(100%, 140px)",
textTransform: "none",
"&.MuiButton-outlinedLight": {
"&::before": {
content: '"outlined light doesn\'t work!"'
}
}
}, https://codesandbox.io/s/admiring-cache-mq4ee?file=/src/App.tsx
variants: [
// light variant
{
props: { color: "light" },
style: {
"&::before": {
content: '"light"'
}
}
},
{
props: { color: "light", variant: "outlined" },
style: {
"&::before": {
content: '"outlined light doesn\'t work!"'
}
}
}
], https://codesandbox.io/s/elegant-taussig-1yudl?file=/src/App.tsx @danielmulvad is it clearer? Do you see something that we could improve in the documentation? |
@danielmulvad The two links are identical, I assume you meant:
I believe there should be a mention of types and props that can be extendable in the API pages. |
I am extending the palette to include a "light" theme, so I override the PaletteOptions for the light option to be available.
Current Behavior 😯
Expected Behavior 🤔
using styleOverrides to override a new palette color should work.
Steps to Reproduce 🕹
https://codesandbox.io/s/hopeful-fast-c9pqt?file=/src/App.tsx, uncomment lines 58 to 62 to break.
App.test.tsx ensures that MuiButton-outlinedLight is created.
Steps:
Context 🔦
I am using more than the primary and secondary colors, and want to add a third "light" color to the palette. This works fine, but mixing colors and variants among components breaks.
Your Environment 🌎
`npx @material-ui/envinfo`
Browser Version: Google Chrome | 91.0.4437.0 (Official Build) canary (x86_64)
The text was updated successfully, but these errors were encountered: