反应管理版本:3.8.4
\n我有一个反应管理应用程序,我正在尝试在浅色和深色主题之间切换。
\n下面您可以看到Theme.js,我在其中导出两个具有默认主题覆盖的对象,如文档中所述。(https://material-ui.com/pt/customization/default-theme/)
\nexport const darkTheme = {\npalette: {\n type: \'dark\'\n},\noverrides: {\n MuiAppBar: {\n colorSecondary: {\n backgroundColor: \'#424242\', //\'#1e4c9a\',\n color: \'#fff\'\n },\n },\n MuiButton: {\n textPrimary: {\n color: \'#fff\',\n }\n },\n MuiTypography: {\n colorPrimary: {\n color: \'#fff\'\n }\n },\n MuiDrawer: {\n paper: {\n paddingTop: \'20px\'\n }\n },\n MuiFilledInput: {\n underline: {\n \'&:after\': {\n borderBottomColor: \'#bf9f00\'\n }\n }\n },\n MuiFormLabel: {\n root: {\n \'&$focused\': {\n color: \'#bf9f00\'\n }\n }\n },\n}\n}\n\nexport const lightTheme = {\n …
Run Code Online (Sandbox Code Playgroud)