add custom-control-input color variations

pull/3046/head
REJack 2020-09-22 15:21:52 +02:00
parent e8744690ce
commit fd734c977a
2 changed files with 38 additions and 0 deletions

View File

@ -311,3 +311,12 @@ body.text-sm {
@include custom-range-variant($name, $color); @include custom-range-variant($name, $color);
} }
} }
// custom control input variations
@each $name, $color in $theme-colors {
@include custom-control-input-variant($name, $color);
}
@each $name, $color in $colors {
@include custom-control-input-variant($name, $color);
}

View File

@ -79,3 +79,32 @@
} }
} }
} }
// Custom Control Input Variant
@mixin custom-control-input-variant($name, $color) {
.custom-control-input-#{$name} {
&:checked ~ .custom-control-label::before {
border-color: $color;
@include gradient-bg($color);
}
&:focus ~ .custom-control-label::before {
// the mixin is not used here to make sure there is feedback
@if $enable-shadows {
box-shadow: $input-box-shadow, 0 0 0 $input-btn-focus-width rgba($color, .25);
} @else {
box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .25);
}
}
&:focus:not(:checked) ~ .custom-control-label::before {
border-color: lighten($color, 25%);
}
&:not(:disabled):active ~ .custom-control-label::before {
background-color: lighten($color, 35%);
border-color: lighten($color, 35%);
}
}
}