Setting the default elevation for MuiPaper in the theme using the documented method does not work. I can set other default properties of MuiPaper and they do work.
const theme = createMuiTheme({
props: {
MuiPaper: {
elevation: 10,
square: true
}
}
});
https://codesandbox.io/s/fancy-bird-ekr8b?fontsize=14&hidenavigation=1&theme=dark
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.8.3 |
| React |16.11.0|
| Browser |Chrome 78|
| TypeScript |no|
@jpodpro Not sure if this will help you but Card uses a different default prop for elevation than Paper.
Try adding this:
MuiCard: {
elevation: 0
}
If you look at Card.js They set the elevation based on a raised prop. So that's why you need to directly add an elevation to Card itself to override that.
https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Card/Card.js#L20
@KyruCabading thanks
Most helpful comment
@jpodpro Not sure if this will help you but Card uses a different default prop for elevation than Paper.
Try adding this:
If you look at Card.js They set the elevation based on a
raisedprop. So that's why you need to directly add anelevationto Card itself to override that.https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Card/Card.js#L20