I am trying to re-color the thumb slider for a Bootstrap 5 range control, but I can’t seem to find the magic combination.
Here is a stackblitz: https://stackblitz.com/edit/stackblitz-starters-3vywax?file=src%2Fmain.ts
The BS5 docs provide sass variable, but I can’t eem to get the code to pickup my overrides.
2
Answers
Derived from sol answer. You can wrap this on a class and style the slider.
We can style the thumb using
::-webkit-slider-thumb
, where we use the bootstrap variable--bs-warning
.SCSS:
HTML:
Stackblitz Demo
You can override the
$primary
SCSS variable which is used on the slider thumb:Updated StackBlitz
If you need the slider color to be a different color than the primary color, see the other answer.