'How to change the disabled track color of Mui <Slider/>

How can I change the disabled colour of the track of Mui Slider?

I have a slider like this:

<Slider aria-label="Volume" value={60} disabled onChange={() => console.log('')} />

and I have styled it in the createTheme.components function like this:

MuiSlider: {
  styleOverrides: {
    thumb: {
      color: colors.neutralWhite,
      '&.Mui-disabled': {
        color: colors.neutral70,
      },
    },
    track: {
      color: colors.neutralBlack,
      '&.Mui-disabled': {
        color: colors.neutral70,
      },
    },
    rail: {
      color: colors.neutral70,
    },
    disabled: {
      color: colors.errorDefault,
    },
  },
},

this is the final product:

enter image description here

The issue with this is that when the disabled property is set, I want the colour of the slider to change (track, rail and thumb). But based on my implementation above only the thumb colour changes. (below the thumb changes to ash, but the track still remains black)

enter image description here

How can I make the track colour change?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source