如何覆盖 Material-UI 中通过 应用样式的组件的主题withStyles
?
当我查看有问题的组件时,我在 DOM 中看到以下内容:
我正在尝试重新设置 Backstage 的样式,并且现在正在查看 MuiSelect 组件。Backstage 通过使用withStyles
. 查看 DOM 我正在尝试调整通过WithStyles(ForwardRef(InputBase))-input-75764
类应用的 CSS。
在 Backstage 的Select.tsx
组件文件中,样式是这样定义的:
const BootstrapInput = withStyles((theme: Theme) =>
createStyles({
root: {
'label + &': {
marginTop: theme.spacing(3),
},
},
input: {
borderRadius: 4,
position: 'relative',
backgroundColor: theme.palette.background.paper,
border: '1px solid #ced4da',
fontSize: 16,
padding: '10px 26px 10px 12px',
transition: theme.transitions.create(['border-color', 'box-shadow']),
fontFamily: 'Helvetica Neue',
'&:focus': {
background: theme.palette.background.paper,
borderRadius: 4,
},
},
}),
)(InputBase);
如何使用 Material-UIcreateTheme
来定位这些样式?