Using the most recent version of MUI (v5) and incorporating CssBaseline
from @mui/materials. Typically, in CSS, I would set up my styles like this:
body, html, #root {
width: 100%;
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
font-size: 62.5%; /* This converts rem values for easier calculation */
text-align: left;
}
MUI Body
(add the following to my theme)
components: {
MuiCssBaseline: {
styleOverrides: {
body: {
width: '100%',
height: '100%',
minHeight: '100%',
margin: 0,
padding: 0,
fontSize: '62.5%', // This maintains the rem conversion for consistency
textAlign: 'left'
}
}
}
}
MUI Root
(add the following to my sxStyle e.g:
sx={{...sxLayout, ...sxLayout.root}}
)
const sxLayout = {
flexDirection: 'column',
root: {
width: '100%',
height: '100%',
minHeight: '100%',
margin: 0,
padding: 0,
fontSize: '62.5%', // This ensures consistent rem values
textAlign: 'left',
'&': {
width: '100%',
height: '100%',
minHeight: '100%',
margin: 0,
padding: 0,
fontSize: '62.5%', // Maintains the conversion ratio
textAlign: 'left'
},
'&.MuiListItemButton-root': {
width: '100%',
height: '100%',
minHeight: '100%',
margin: 0,
padding: 0,
fontSize: '62.5%', // Keeps the rem conversion intact
textAlign: 'left'
}
}
}
MUI Html
(????)
????