Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the color left side and right side of the slider #79

Open
azoom-le-trung-kien opened this issue Aug 22, 2023 · 1 comment
Open

Comments

@azoom-le-trung-kien
Copy link

azoom-le-trung-kien commented Aug 22, 2023

image
I want to change the color left side and right side of the slider. Can I ?🥲🥲🥲

@uurshin
Copy link

uurshin commented Nov 13, 2023

Old issue, but as I had the same need today I will post a solution. I found that you can use the options parameters, which allow you to use noUiSlider base functionalities.

If you don't want any color between the two handles, you need this :

<Slider
   :options="{connect: [true, false, true]}"
   v-model="values"
/>

This will tell to add a connection between the start of the slide and the first handle, and between the second handle and the end of the slide. Now you just need to add css rules to change the background colors :

.slider-connect {
   background: red;
}
.slider-connect + .slider-connect {
   background: green;
}

If you want to keep the color in the middle, than you don't need the options parameters, just add three css rules.
Hope this help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants