Does anyone have a solution for customizing the appearance of the Bootstrap switch button when it is disabled? I have successfully styled it for the enabled state, but it defaults to a dark appearance when disabled. I would like the disabled state to have the same appearance as when it is enabled.
Additionally, is it possible to determine if the button is enabled or disabled, and then make the words "annually" or "monthly" bold accordingly? Thank you!
.form-check.form-switch .form-check-input {
box-shadow: none;
cursor: pointer;
height: 20px;
width: 40px;
background-color: #5382FB;
}
.form-check-input[type="checkbox"]:disabled + .form-check-label::before {
background-color: #5382FB;
border-color: #5382FB;
opacity: 1;
}
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<div class="d-flex justify-content-center align-items-center">
<div class="monthly me-3">Monthly</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault">
</div>
<div class="annually ms-3">Annually</div>
</div>