Even after having read the Material UI Customization rules, I haven't quite understood how to properly target nested elements.
Here is an example, where I am targeting the label of the <TextField>
component. The styling for the label works, but the styling for when the label is shrinked does not.
const useStyles = makeStyles({
label: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
right: '22px',
bottom: '0px',
'&.MuiInputLabel-shrink': {
right: 'unset',
color: 'green',
},
'&. MuiInputLabel-shrink': {
right: 'unset',
color: 'green',
},
'&.shrink': {
right: 'unset',
color: 'green',
},
'&.shrinked': {
right: 'unset',
color: 'green',
},
},
'&.MuiInputLabel-shrink': {
color: 'purple',
},
});
question from:
https://stackoverflow.com/questions/65907936/how-to-properly-target-the-matrial-ui-nested-prop-attributes 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…