cro*_*raf 4 reactjs material-ui
我正在为 React 使用 material-ui v.1 库,并且想要设置Paper组件的背景。
我想使用主题来做到这一点。
我正在使用顶级
const theme = createMuiTheme({
palette: {
//type: 'light'
}
});
<MuiThemeProvider theme={theme}>
</MuiThemeProvider>
Run Code Online (Sandbox Code Playgroud)
我应该投入什么createMuiTheme来做到这一点?
我尝试了几个选项(如palette:{paper: {backgroundColor: 'black'}}、 和paper: {backgroundColor: 'black'}、 和backgroundColor: {paper: 'black'}),但没有任何效果。
注意:type: 'light',type: 'dark'工作正常。
根据https://material-ui-next.com/customization/themes/,应使用以下属性:
const theme = createMuiTheme({
palette: {
background: {
paper: 'red'
}
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2358 次 |
| 最近记录: |