material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[slider] Reverse Slider

Open jaygood opened this issue 11 years ago • 3 comments

I have the case where values >= the current slider position are important. Reversing the trackColorSelected and trackColor with selectionColor from the theme gets me half way there (but it also reverses the handle's color and the disabled color).

jaygood avatar Jun 05 '15 18:06 jaygood

@jaygood with the new theming API, once you have generated an muiTheme object, you can override specific styles for the slider as listed here

See the docs on overriding theme variables -- scroll to the "Overriding Theme Variables" section.

shaurya947 avatar Nov 13 '15 21:11 shaurya947

Nope, you're mistaken, @shaurya947. The problem is that the handle's color is tied to the selectionColor of the theme. So, when I override then track to have the selectionColor and override the filled portion to have the trackColor, the handle is given the trackColor. I would like the handle to also have the selectionColor.

In case you don't understand, you're welcome to try it out yourself. I use something like this:

const selectionColor = 'blue';
const trackColor = 'gray';
const override = {
  trackColor: selectionColor,
  trackColorSelected: selectionColor,
  handleColorZero: selectionColor,
  handleFillColor: selectionColor,
  selectionColor: trackColor
}

jaygood avatar Nov 23 '15 15:11 jaygood

Hi, @jaygood did you manage to change color of handle?

rhoman avatar Sep 09 '16 12:09 rhoman