2014-03-10 02:18:48 -04:00
|
|
|
// Form control focus state
|
|
|
|
//
|
|
|
|
// Generate a customized focus state and for any input with the specified color,
|
2017-09-26 11:14:52 -04:00
|
|
|
// which defaults to the `$input-focus-border-color` variable.
|
2014-03-10 02:18:48 -04:00
|
|
|
//
|
|
|
|
// We highly encourage you to not customize the default value, but instead use
|
|
|
|
// this to tweak colors on an as-needed basis. This aesthetic change is based on
|
|
|
|
// WebKit's default styles, but applicable to a wider range of browsers. Its
|
|
|
|
// usability and accessibility should be taken into account with any change.
|
|
|
|
//
|
|
|
|
// Example usage: change the default blue border and shadow to white for better
|
|
|
|
// contrast against a dark gray background.
|
2014-12-02 17:02:35 -05:00
|
|
|
@mixin form-control-focus() {
|
2014-03-10 02:18:48 -04:00
|
|
|
&:focus {
|
(#22414) Rename for consistency `$input-bg-disabled`, `$input-bg-focus`, `$input-border-color-focus`, `$input-box-shadow-focus`, `$input-color-focus`, `$input-color-placeholder` to `$input-disabled-bg`, `$input-focus-bg`, `$input-focus-border-color`, `$input-focus-box-shadow`, `$input-focus-color`, `$input-placeholder-color`, respectively
2017-06-08 22:11:40 -04:00
|
|
|
color: $input-focus-color;
|
|
|
|
background-color: $input-focus-bg;
|
|
|
|
border-color: $input-focus-border-color;
|
2015-04-23 04:10:14 -04:00
|
|
|
outline: none;
|
(#22414) Rename for consistency `$input-bg-disabled`, `$input-bg-focus`, `$input-border-color-focus`, `$input-box-shadow-focus`, `$input-color-focus`, `$input-color-placeholder` to `$input-disabled-bg`, `$input-focus-bg`, `$input-focus-border-color`, `$input-focus-box-shadow`, `$input-focus-color`, `$input-placeholder-color`, respectively
2017-06-08 22:11:40 -04:00
|
|
|
@include box-shadow($input-focus-box-shadow);
|
2014-03-10 02:18:48 -04:00
|
|
|
}
|
|
|
|
}
|
2017-06-10 19:30:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
@mixin form-validation-state($state, $color) {
|
|
|
|
|
|
|
|
.form-control,
|
|
|
|
.custom-select {
|
|
|
|
.was-validated &:#{$state},
|
|
|
|
&.is-#{$state} {
|
|
|
|
border-color: $color;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 0 .2rem rgba($color,.25);
|
|
|
|
}
|
|
|
|
|
2017-08-12 20:13:53 -04:00
|
|
|
~ .#{$state}-feedback,
|
|
|
|
~ .#{$state}-tooltip {
|
2017-06-10 19:30:26 -04:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: redo check markup lol crap
|
|
|
|
.form-check-input {
|
|
|
|
.was-validated &:#{$state},
|
|
|
|
&.is-#{$state} {
|
|
|
|
+ .form-check-label {
|
|
|
|
color: $color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// custom radios and checks
|
|
|
|
.custom-control-input {
|
|
|
|
.was-validated &:#{$state},
|
|
|
|
&.is-#{$state} {
|
|
|
|
~ .custom-control-indicator {
|
|
|
|
background-color: rgba($color, .25);
|
|
|
|
}
|
|
|
|
~ .custom-control-description {
|
|
|
|
color: $color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// custom file
|
|
|
|
.custom-file-input {
|
|
|
|
.was-validated &:#{$state},
|
|
|
|
&.is-#{$state} {
|
|
|
|
~ .custom-file-control {
|
|
|
|
border-color: $color;
|
|
|
|
|
|
|
|
&::before { border-color: inherit; }
|
|
|
|
}
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 0 .2rem rgba($color,.25);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|