I'm having trouble adding the styling to a Material UI Switch in React when it is disabled. I'd like to use withStyles for this. The handling for the checked vs unchecked states works fine as does the styling for the track, but nothing I've tried has worked to style the disabled state of either the thumb or the track.
Here's the code I'm using including some commented out attempts to style the disabled state:
const MySwitch = withStyles({
switchBase: {
color: "orange",
opacity: 0.8,
"&$checked": {
color: "orange",
opacity: 1
},
"&$checked + $track": {
backgroundColor: "black",
opacity: 1
},
// "&$checked + $disabled": {
// color: "gray",
// opacity: 1
// },
// "&disabled": {
// color: "gray",
// opacity: 1
// },
// "&:disabled": {
// color: "gray",
// opacity: 1
// },
},
// disabled: {
// "& + $thumb": {
// color: "gray"
// }
// },
checked: {},
track: {}
})(Switch);
Any thoughts?
