title: How to customise DateTimePicker from Material-UI
body: <p>I am trying to customise the <code>DateTimePicker</code> from <code>Material-UI</code>. Here is its documentation: <a href="https://material-ui-pickers.dev/api/DateTimePicker" rel="nofollow noreferrer">https://material-ui-pickers.dev/api/DateTimePicker</a></p>
  
  <p>There is no section for the styling. I want to change the main color for all the coloured components. What I've tried so far is using the general  <code>theme</code> documentation and try to change the style of the theme:</p>
  
  <pre><code>const theme = createMuiTheme({
    status: {
      danger: '#FF72B1',
    },
    dateTimePicker: {
      headerColor: '#FF72B1',
      selectColor: '#FF72B1',
    },
    datePicker: {
      selectColor: '#FF72B1',
      headerColor: '#FF72B1'
    }
  });
  
  function App() {
    return (
      &lt;ThemeProvider theme={theme}&gt;
        &lt;Routes /&gt;
      &lt;/ThemeProvider&gt;
    )
  }
  </code></pre>
  
  <p>As far as I understood from the <code>theme</code> documentation, the only thing that I've done so far is defining variables with styles, but they are not going to be applied. I have to specify them in the exact component, and here comes the tricky part.</p>
  
  <p>In my <code>Material-UI DateTimePicker</code>:</p>
  
  <pre><code>function MaterialDateTimePicker() {
    const classes = useStyles()
    return (
      &lt;Fragment&gt;
        &lt;DateTimePicker
          label={label}
          inputVariant="outlined"
          value={value}
          onChange={onChange}
          classes={{
            root: classes.root,
            checked: classes.checked,
          }}
        /&gt;
      &lt;/Fragment&gt;
    );
  }
  </code></pre>
  
  <p>I have tried to applied the styling:</p>
  
  <pre><code>const useStyles = makeStyles(theme =&gt; ({
    root: {
      color: '#FF72B1',
      backgroundColor: 'orange',
      '&amp; &gt; .MuiPickerDTToolbar-toolbar.MuiToolbar-root': {
        backgroundColor: 'green'
      }
    },
    checked: {},
  }));
  </code></pre>
  
  <p>This is how I've been trying to style components with this library, based on research, reading the docu, and some SO answers:</p>
  
  <p><a href="https://stackoverflow.com/questions/60459932/how-to-change-material-ui-select-border-and-label/60461876?noredirect=1#comment106972284_60461876">How to change material UI select border and label</a></p>
  
  <p>So basically you have to go to the documentation, try to find the .XXX class that matches the component that you want to customise, and if documentation is missing, you have to go to the DOM, and start looking for this class.</p>
  
  <p>I did that, but I have a couple of questions:</p>
  
  <p>1) In my particular case, I have the problem that on my <code>DateTimePicker</code> I apply the <code>root</code> classes, which are on the <code>input</code> component level. The calendar that pops up, is not a children of this component, it's open by javascript, therefore I don't know how to access it.</p>
  
  <p>This syntax does not work any longer:</p>
  
  <pre><code>root: {
      color: '#FF72B1',
      backgroundColor: 'orange',
      '&amp; &gt; .MuiPickerDTToolbar-toolbar.MuiToolbar-root': {
        backgroundColor: 'green'
      }
    },
  </code></pre>
  
  <p>Because <code>root</code> is the input, not the calendar that pop ups.</p>
  
  <p>2) Is this really the way to go with this library? Because all the answers on SO and complains go on this direction. Does anybody know another strategy?</p>
  
  <p>3) In <code>@material-ui/pickers</code> <code>node_modules</code> folder I couldn't find the css file. I would like to pick it and customise there, like it's possible for <code>react-dates</code> library etc. Is that possible? Where are the css stylings?</p>
  
  <p>I've prepared a sandbox with what I've tried:</p>
  
  <p><a href="https://codesandbox.io/s/inspiring-napier-zh4os" rel="nofollow noreferrer">https://codesandbox.io/s/inspiring-napier-zh4os</a></p>
  
  <p>(Unfortunately the utils library is installed but not working, locally in my computer the picker works fine, I just can't style it)</p>