Hakon Grotte
10/06/2022, 9:30 AMsx
prop?Hakon Grotte
10/06/2022, 9:30 AMOverriding nested component styles
section:
<Slider
defaultValue={30}
sx={{
width: 300,
color: 'success.main',
'& .MuiSlider-thumb': { <-- Like this
borderRadius: '1px',
},
}}
/>
turansky
10/06/2022, 10:19 AMButton {
sx {
// your styles
}
}
Hakon Grotte
10/06/2022, 12:06 PMwidth
and color
in the example above are straightforward. However, it is the
'& .MuiSlider-thumb': {
borderRadius: '1px',
},
styling prop I am struggling with. Effectively it would be a “free-text” styling prop without type-safety to target specific css class namesturansky
10/06/2022, 12:11 PMsx {
and(MuiSlider.thumb) {
// ... your props
}
}
Hakon Grotte
10/06/2022, 12:46 PM