I'm using bootstrap 4 with sass in my application. Bootstrap provides a custom input checkbox but only for the primary theme color.
I've read some things about generating classes with sass using @each and @mixin, but none of them were clear to me. As you can se in the code bellow i did it by hand typing every class and color.
.custom-checkbox-primary{
.custom-control-input:checked ~ .custom-control-label::before {
color: $primary;
border-color: $primary;
background-color: $primary;
}
}
.custom-checkbox-secondary{
.custom-control-input:checked ~ .custom-control-label::before {
color: $secondary;
border-color: $secondary;
background-color: $secondary;
}
}
.custom-checkbox-danger{
.custom-control-input:checked ~ .custom-control-label::before {
color: $danger;
border-color: $danger;
background-color: $danger;
}
}
I want sass to generate these 'custom-checkbox-{{theme-color}}' dynamically for me.