我正在使用 Material-UI ListItem 组件,我想摆脱默认的背景颜色。我已经尝试过使用类,但是我的值被这个覆盖了:
如何禁用此默认规则?
您可以全局覆盖任何 Material UI 组件的样式。
在您的应用程序中查找您调用 的点createMuiTheme
,然后添加和输入这样的overrides
字段。
const theme = createMuiTheme({
palette: {
/* you should already have stuff here, keep it */
},
typography: {
/* you should already have stuff here, keep it */
},
overrides: {
MuiListItem: {
root: {
backgroundColor: "red",
},
},
},
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句