文本变为白色,背景变为黑色,然后再次单击,反之亦然。我没有为任何元素专门指定颜色道具或背景道具,但一切正常。问题出在下面的按钮上
如您所见,它们是红色的并且来自primary.light,尽管当激活黑暗主题时,它必须是primary.dark,但不是...
const theme = createMuiTheme({
palette: {
type: mode,
primary: {
light: "#FF0000",
main: "#3f50b5",
dark: "#002884",
contrastText: "#FF0000"
},
secondary: {
light: "#ff7961",
main: "#f44336",
dark: "#ba000d",
contrastText: "#000"
}
},
typography: {
useNextVariants: true
}
});