Currently in the process of creating a custom style-sheet that overlays the default Bootstrap 4.3.1 theme, encountering some challenges specifically with styling the checkboxes and radiobuttons.
Struggling to find a way to change the color of checkboxes and radiobuttons when they are checked. Hoping to switch from the default appearance to this design upon click: https://i.sstatic.net/fdktS.jpg
Attempted to modify the _input-group.scss
file in order to customize the code:
.input-group-text {
display: flex;
align-items: center;
padding: $input-padding-y $input-padding-x;
margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
@include font-size($input-font-size); // Match inputs
font-weight: $font-weight-normal;
line-height: $input-line-height;
color: $input-group-addon-color;
text-align: center;
white-space: nowrap;
background-color: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color;
@include border-radius($input-border-radius);
// Nuke default margins from checkboxes and radios to vertically center within.
input[type="radio"],
input[type="checkbox"] {
margin-top: 0;
background-color: #e5f0f8;
color: #005db8; // checkmark color;
}
}
To adjust the size, duplicated Bootstrap's _forms.scss
file and updated the values:
.form-check-input {
position: absolute;
margin-top: $form-check-input-margin-y;
margin-left: -$form-check-input-gutter;
width: 1.052rem; // changed default width
height: 1.052rem; //changed default height
&:disabled ~ .form-check-label {
color: $text-muted;
}
}
If there are any suggestions or corrections on what might be done incorrectly, they are greatly appreciated. Thank you.