How do I properly use theme overrides for the MUISwitch “bar” color when checked?
问题 After perusing the source code I've tried the following, which works but generates a warning in the console. const myTheme = createMuiTheme({ overrides: { MuiSwitch: { checked: { "& + $bar": { opacity: 1.0, backgroundColor: "rgb(129, 171, 134)" // Light green, aka #74d77f } } } } }); The error/warning I get is: Warning: Material-UI: the `MuiSwitch` component increases the CSS specificity of the `checked` internal state. You can not override it like this: { "checked": { "& + $bar": { "opacity"