zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
883 stars 231 forks source link

Possible to use a gradient as background for the slider? #291

Open Fuxx117 opened 1 year ago

Fuxx117 commented 1 year ago

Hey guys,

is it possible to use a gradient as the background for the slider? We always have the sliderTrack-0 and the sliderTrack-1. But with this i cant achieve the one im searching for. I already use the slider on my project, so i dont want to implement another slider. Are there any suggestions? Below you can see a screenshot what im trying to achieve.

123

Thanks in advance.

moloko commented 1 year ago

you just do something like:


.sliderTrack-0 {
    background: linear-gradient(90deg, rgb(246, 192, 3) 0%, rgb(255, 255, 255) 100%);
}
.sliderTrack-1 {
    background: linear-gradient(90deg, rgb(255, 255, 255) 0%, rgb(118, 244, 246) 100%);
}