我试图通过覆盖主题 css 来更改项目中所有按钮的颜色。按钮的颜色已更改但悬停颜色仍然透明,我该如何覆盖它?
除了为我的每个按钮添加一个类之外,还有其他方法吗?
按钮的所有变体都不应该遵循根的 css 吗?
const theme = createMuiTheme({
palette: {
primary: {
light: '#35C37D',
main: '#35C37D',
dark: '#35C37D',
// contrastText: will be calculated to contrast with palette.primary.main
},
secondary: {
light: '#35C37D',
main: '#35C37D',
// dark: will be calculated from palette.secondary.main,
contrastText: '#35C37D',
},
// error: will use the default color
},
overrides: {
MuiButton: {
// Name of the rule
root: {
// Some CSS
background: 'rgba(53, 195, 125, 100)',
borderRadius: 0,
border: 0,
colorInherit: '#fff', …
Run Code Online (Sandbox Code Playgroud)