I want to customize the background color of each pill, but I also want a faded version of that custom color with an active color matching the full color of the corresponding pill.
- pill one > faded red
- pill two > faded blue
- pill three > faded black
When
- pill one active > red
- pill two active > blue
- pill three active > black
This is my code:
<ul class="nav nav-pills">
<li class="nav-item pill-1">
<a class="nav-link active" href="#">pill one</a>
</li>
<li class="nav-item pill-2">
<a class="nav-link" href="#">pill two</a>
</li>
<li class="nav-item pill-3">
<a class="nav-link" href="#">pill three</a>
</li>
</ul>
Here's the CSS:
.pill-1 a {
background-color: rgba(255, 0, 0, 0.5);
}
And for Bootstrap override:
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #d9d9d9;
}