If you want to customize the appearance of radio buttons, you can modify the styles for both the checked and unchecked states by using CSS selectors like
[input-selector]:checked + label:after
for checked state and
[input-selector]:not(:checked) + label:before
for unchecked state.
[type="radio"]:checked,
[type="radio"]:not(:checked) {
position: absolute;
left: -9999px;
}
/* Additional CSS styling for radio buttons */
[type="radio"]:checked+label,
[type="radio"]:not(:checked)+label {
/* Styles go here */
}
/* More CSS styling for radio buttons */
/* To change the background color, only update the code below*/
.red-input:not(:checked)+label:before {
background: red;
}
/* More customizations for different colors */
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.css" rel="stylesheet"/>
<form class="form-inline m-5">
<div class="form-group">
<div class="mx-2">
<input type="radio" id="test1" name="radio-group" class="red-input">
<label for="test1">Option 1</label>
</div>
<div class="mx-2">
<input type="radio" id="test2" name="radio-group" class="green-input">
<label for="test2">Option 2</label>
</div>
<div class="mx-2">
<input type="radio" id="test3" name="radio-group" class="black-input">
<label for="test3">Option 3</label>
</div>
<div class="mx-2">
<input type="radio" id="test4" name="radio-group" class="silver-input">
<label for="test4">Option 4</label>
</div>
</div>
</form>
For more examples and demos, check this CodePen link.
Update
To apply a default background color for the inputs, utilize the selector
[input-selector]:not(:checked)+label:before
.
.red-input:not(:checked)+label:before {
background: red;
}