1 // Form control focus state
3 // Generate a customized focus state and for any input with the specified color,
4 // which defaults to the `$input-focus-border-color` variable.
6 // We highly encourage you to not customize the default value, but instead use
7 // this to tweak colors on an as-needed basis. This aesthetic change is based on
8 // WebKit's default styles, but applicable to a wider range of browsers. Its
9 // usability and accessibility should be taken into account with any change.
11 // Example usage: change the default blue border and shadow to white for better
12 // contrast against a dark gray background.
13 @mixin form-control-focus() {
15 color: $input-focus-color;
16 background-color: $input-focus-bg;
17 border-color: $input-focus-border-color;
19 // Avoid using mixin so we can pass custom focus shadow properly
21 box-shadow: $input-box-shadow, $input-focus-box-shadow;
23 box-shadow: $input-focus-box-shadow;
29 @mixin form-validation-state($state, $color) {
34 margin-top: $form-feedback-margin-top;
35 font-size: $form-feedback-font-size;
50 background-color: rgba($color, .8);
56 .was-validated &:#{$state},
62 box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
65 ~ .#{$state}-feedback,
66 ~ .#{$state}-tooltip {
73 .was-validated &:#{$state},
81 .custom-control-input {
82 .was-validated &:#{$state},
84 ~ .custom-control-label {
88 background-color: lighten($color, 25%);
92 ~ .#{$state}-feedback,
93 ~ .#{$state}-tooltip {
98 ~ .custom-control-label::before {
99 @include gradient-bg(lighten($color, 10%));
104 ~ .custom-control-label::before {
105 box-shadow: 0 0 0 1px $body-bg, 0 0 0 $input-focus-width rgba($color, .25);
113 .was-validated &:#{$state},
115 ~ .custom-file-label {
116 border-color: $color;
118 &::before { border-color: inherit; }
121 ~ .#{$state}-feedback,
122 ~ .#{$state}-tooltip {
127 ~ .custom-file-label {
128 box-shadow: 0 0 0 $input-focus-width rgba($color, .25);