I made that 3 tooltips have a diferent color with js by data-toggle like this
<span class="tooltipjs" data-toggle="sin-datos" data-placement="right" data-original-title="some text">A</span>
$('[data-toggle="sin-datos"]').hover(function(){
$('.tooltip-inner').css('background-color', 'blue');
$('.tooltip-inner').css('color', 'white');
$('.tooltip-arrow').css('border-right-color', 'blue');
});
In this prototype works fine, the arrows match with the color of the tooltip background jsfiddle prototype (I set the "border-right-color" in three different ways for testing purposes).
But when i put it in my web app doesn't work.
I can set all the arrows color with:
.tooltip .arrow::before {
border-right-color: green;
}
Like i did in thay picture, but i cant change the color by diferent data-toggle as i doing with de background-color of the tooltip.
I search and found that the problem maybe is that the color is set inside pseudo elements (::before) and i cant access with js, i never work with pseudo elements so i am a bit lost.
I alredy try to set it like this...
$('.tooltip-arrow').css('border-right-color', 'color');
$('.tooltip > .tooltip-arrow').css('border-right-color', 'color');
$('.tooltip .tooltip-arrow').css('border-right-color', 'color');
$('.bs-tooltip-auto[x-placement^=right] .arrow::before, .bs-tooltip-right .arrow::before').css('border-right-color', 'color');
$('.tooltip .arrow::before').css('border-right-color', 'color');
But nothing works, im usign bootstrap 4.