Im trying to get a different color for the rendered SVG icon using to control the carousel.
I changed the default color for the arrows as follows:
$carousel-control-color: $secondary !default;
This makes the arrows green as I intended to. But now I have a card with a primary background color and I want the arrows to have a white color inside this particular div. Because you can imagine, $primary color on $primary background is not really readable.
I attemped to try a conditional logic to set the value of the variable but it doesn't override the value as I thought it would be.
.widget {
&.widget-support-slider {
.carousel-control-prev-icon,
.carousel-control-next-icon {
@if $carousel-control-color == $primary{
$carousel-control-color: white;
color: $carousel-control-color;
}
}
}
}
Corrosponding HTML
<div class="card widget-card bg-primary text-light widget-support-slider mt-3">
<div class="card-header py-2">
<span class="text-primary">Lorem</span> ipsum dolor sit
<div class="carousel-controls">
<a class="carousel-control-prev" href="#support-slider" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Vor</span>
</a>
<a class="carousel-control-next" href="#support-slider" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Zurück</span>
</a>
</div>
</div>
<div class="card-body p-0">
...
</div><!-- /.card-body -->
I've also tried to change the color or fill property, but none of these change the arrow colors. Is there a built-in function in the bootstrap sass that I have overlooked?
Cheers.
Bootstrap v4.1