reactjs - 如何禁用 ListItem 的一些 Material UI css
问题描述
我正在使用 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",
},
},
},
});
推荐阅读
- python - 散景删除网格图中元素之间的空间
- r - 在 Bash 中打印 R 脚本的输出
- firebase - Firebase onAuthStateChanged 有效,但不更新 lastSignInTime
- reactjs - 使用 cognito 用户组登录后重定向
- powershell - 我们可以在 PowerShell 中编写明星程序吗?
- python - 尝试加入两个 pandas 数据框但得到“ValueError:您正在尝试合并对象和 int64 列。”?
- ios - 解码为 NSManagedObject 对象后需要获取请求
- php - 在 PHP 中调试 libcurl 本身(低级)
- c++ - 从透视切换到正交保持模型和缩放的相同视图大小
- python - 如何使用 lambda 和 hasattr 过滤嵌套属性上的对象数组?