Using bootstrap 4, I have a simple yes/no custom radio buttons set.
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="rd_1" name="rd" class="custom-control-input green" value="Yes">
<label class="custom-control-label" for="rd_1">Yes</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="rd_2" name="rd" class="custom-control-input red" value="No">
<label class="custom-control-label" for="rd_2">No</label>
</div>
When the user select "Yes", I want that the color of the "Yes" button turn green, and when the user select "No" the color of the "No" button turn red.
I can define the color of both radios using the css below, but how can define different colors for each one?
.custom-control-input:checked ~ .custom-control-label::before {
color: #fff;
border-color: #7B1FA2;
background-color: red;
}
