Since I’ve been editing the Mui switch component for quite long time, It came to my mind the following arrangement of nested styles for setting a new style based on a change on the state:
<code> sx={{
"& .MuiSwitch-thumb": {
"& .Mui-checked": {
color: "#4a3e98",
},
},
"& .MuiSwitch-track": {
"& .Mui-checked": {
backgroundColor: "#4a3e98",
},
},
}}
</code>
<code> sx={{
"& .MuiSwitch-thumb": {
"& .Mui-checked": {
color: "#4a3e98",
},
},
"& .MuiSwitch-track": {
"& .Mui-checked": {
backgroundColor: "#4a3e98",
},
},
}}
</code>
sx={{
"& .MuiSwitch-thumb": {
"& .Mui-checked": {
color: "#4a3e98",
},
},
"& .MuiSwitch-track": {
"& .Mui-checked": {
backgroundColor: "#4a3e98",
},
},
}}
However, this setup has no effect in the overall design. Any ideas to make it work?