我在我的项目中使用了MUI,我在div
中有一个Checkbox
,背景是黑色的.但它看起来不太好,因为Checkbox
也是黑色的.如何将Checkbox
的 colored颜色 从黑色更改为其他 colored颜色 ?
我在我的项目中使用了MUI,我在div
中有一个Checkbox
,背景是黑色的.但它看起来不太好,因为Checkbox
也是黑色的.如何将Checkbox
的 colored颜色 从黑色更改为其他 colored颜色 ?
您需要使用iconStyle
,但由于复选框图标是SVG图像,因此需要使用fill
而不是color
设置 colored颜色 :
https://jsfiddle.net/27Lmaz48/1/
<Checkbox label='My checkbox'
labelStyle={{color: 'white'}}
iconStyle={{fill: 'white'}}
/>