【发布时间】:2019-01-28 04:42:35
【问题描述】:
我想覆盖material ui for React 中所有选项卡的选定文本颜色。我知道我可以使用如下代码覆盖某些部分:
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>
However, when the tab is selected it applies a class such as '.MuiTab-textColorPrimary-144.MuiTab-selected-146'.选择 Tab 组件时,如何为 textColorPrimary 指定全局覆盖颜色?我对全局覆盖而不是单个实例覆盖特别感兴趣。缺少 Tab 组件的特定方式,我将如何为“selected”primaryTextColor 指定全局覆盖?
【问题讨论】:
标签: reactjs tabs overriding material-ui