Can't style datepiker popup dialog

前端 未结 2 1030
一整个雨季
一整个雨季 2021-01-03 03:25

I have a problem with customizing the datepicker popup dialog(For example change color of header). I can\'t style it by attribute style like textField by textFieldStyle. It

2条回答
  •  借酒劲吻你
    2021-01-03 03:53

    If you are using the latest version of Material-UI, things changed. MuiThemeProvider and getMuiTheme are replaced by createMuiTheme and ThemeProvider respectively.

    You can use like this: import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';

    Now Material-UI is using tree-shaking mechanism to avoid unnecessary bundles, so destructing is well to go.

    To change the header, use something like this:

    const muiTheme = createMuiTheme({
        overrides: {
            MuiPickersToolbar: {
                toolbar: { backgroundColor: 'var(--themeP)' }
            },
    
    ...
    
    

提交回复
热议问题