I am new to Material UI and have taken deep dive because we are using it at work.
I found that the following works when added to createMuiTheme:
overrides: {
MuiListItem: {
root: {
'&$selected': { color: '#fff' }
}
}
}
I don't see anything about this in the docs for version 4. Is this valid for the long run, or is there a chance it will be depricated?
If this is a good way to make custom global styles, are there docs that have more resources in on how to do this?
Is there a better way to create custom global styles with supporting documentation?
@adamhinckley It's documented in https://material-ui.com/customization/globals/#css. We have no plan to remove this feature.
I have personally used it a few minutes ago, in this example I would rather customize the Container globally than create a wrapping component:
theme.overrides = {
MuiContainer: {
root: {
paddingLeft: theme.spacing(1),
paddingRight: theme.spacing(1),
[theme.breakpoints.up('sm')]: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
},
[theme.breakpoints.up('md')]: null,
},
},
};
Most helpful comment
@adamhinckley It's documented in https://material-ui.com/customization/globals/#css. We have no plan to remove this feature.
I have personally used it a few minutes ago, in this example I would rather customize the Container globally than create a wrapping component: