我想为 React覆盖Material ui 中所有选项卡的选定文本颜色。我知道我可以使用以下代码覆盖某些部分:
const theme = createMuiTheme({
overrides: {
MuiTab: {
root: {
color: '#000000',
backgroundColor: '#ffffff',
'&:hover': {
backgroundColor: 'rgba(108, 130, 168, 0.11764705882352941)',
color: '#000000',
}
}
}
}
});
其次是
<MuiThemeProvider theme={theme}>
<HomePage/>
</MuiThemeProvider>
但是,选择选项卡时,它会应用一个类,例如“muitab-textColorprimary-144.muitab-selected-146”。当 Tab 组件被选中时,如何为 textColorPrimary 指定全局覆盖颜色?我对全局覆盖而不是单个实例覆盖特别感兴趣。缺少 Tab 组件的特定方式,我将如何为“选定的”primaryTextColor 指定全局覆盖?