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

[component: styleOverrides] No longer working #24262

Closed
mtr1990 opened this issue Jan 4, 2021 · 2 comments · Fixed by #24253
Closed

[component: styleOverrides] No longer working #24262

mtr1990 opened this issue Jan 4, 2021 · 2 comments · Fixed by #24253
Assignees
Labels
bug 🐛 Something doesn't work

Comments

@mtr1990
Copy link

mtr1990 commented Jan 4, 2021

In previous versions it worked fine, but now it's not working anymore

Here is the simulation of that behavior
https://codesandbox.io/s/globalthemeoverride-material-demo-forked-46yj7?file=/demo.js:0-760

Please help me, Thanks!

@mtr1990 mtr1990 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 4, 2021
@oliviertassinari oliviertassinari removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 4, 2021
@mnajdova
Copy link
Member

mnajdova commented Jan 4, 2021

Thanks for reporting. I've tested locally and seems like #24253 will fix it. @oliviertassinari FYI

@mtr1990
Copy link
Author

mtr1990 commented Jan 4, 2021

Hi @mnajdova , I have also tried some other properties but it doesn't seem to work

It woking fine with variants:[]
but styleOverrides There seems to be a lot of problems

const theme = createMuiTheme({
components: {
MuiButton: {
styleOverrides: {
root: { fontSize: "1rem" }, // <= Working
sizeSmall: { fontSize: "12rem", lineHeight: "22px" }, // <= Not Working
sizeLarge: { fontSize: "12rem" }, // <= Not Working
contained: { backgroundColor: "green", fontSize: "12rem" }, // <= Not Working
containedPrimary: { backgroundColor: "red" } // <= Not Working
},
variants: [
{
props: { size: "small" }, // <= Working
style: { fontSize: 14, lineHeight: "22px", backgroundColor: "red" } // <= Working
},
{
props: { size: "large" }, // <= Working
style: { height: 48, backgroundColor: "green" } // <= Working
}
]
}
}
});

https://codesandbox.io/s/globalthemeoverride-material-demo-forked-46yj7?file=/demo.js

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

Successfully merging a pull request may close this issue.

3 participants