I cannot find any documentation for ...theme.mixins.toolbar in the material-ui docs. What does this do? How do I change or use it?
The theme specifies the color of the components, darkness of the surfaces, level of shadow, appropriate opacity of ink elements, etc. Themes let you apply a consistent tone to your app. It allows you to customize all design aspects of your project in order to meet the specific needs of your business or brand.
The Toolbar is a flex container, allowing flex item properites to be used to lay out the children. classes. object. Override or extend the styles applied to the component.
It simply adds a minimum height to an element. It's useful when you use the AppBar with a content section below, and you want to add a spacer at the top of your content so it doesn't disappear under the AppBar, for example.
I can't find specific documentation on it, but there are examples of it being used in the Material-UI layout examples and I believe it might be created by this function.
More specifically, it's used in the Dashboard example:
toolbarIcon: {
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-end',
padding: '0 8px',
...theme.mixins.toolbar,
},
This would result in something like:
toolbarIcon: {
display: flex;
align-items: center;
justifyContent: flex-end;
padding: 0 8px;
min-height: 64px;
}
There is global default theme. Specifically the theme.mixin.toolbar property on the object adds a min height.
theme:
breakpoints: Object
direction: "ltr"
mixins: Object
gutters: f gutters()
toolbar: Object
minHeight: 56
@media (min-width:0px) and (orientation: landscape): Object
@media (min-width:600px): Object
From the site:
Tip: you can play with the documentation theme object in your console, as the theme variable is exposed on all the documentation pages. Please note that the documentation site is using a custom theme.
If you want to learn more about how the theme is assembled, take a look at material-ui/style/createMuiTheme.js, and the related imports which createMuiTheme uses.
Here is the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With