I trying to override MUI5 checkbox CSS fields, this is the current status:

My CSS classes are:
MuiCheckbox: {
styleOverrides: {
root: {
".MuiSvgIcon-root": {
backgroundColor: "white",
},
},
},
},
And the structure is:
<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-7w1q46-MuiSvgIcon-root" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="CheckBoxIcon">
<path id="kk" d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path>
</svg>
My question is how can i remove the white border without removing the backgroundColor?(without the backgroundColor the inner check is transparent)
Considering I can't override the viewBox values I found a simple solution
my updated CSS override:
MuiCheckbox: {
styleOverrides: {
root: {
".MuiSvgIcon-root": {
backgroundColor: "white",
path: {
transform: "translate(-2px, -2px) scale(1.2)",
},
},
},
},
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With