2014-03-10 07:18:48 +01:00
|
|
|
// Form validation states
|
|
|
|
//
|
2014-12-02 23:02:35 +01:00
|
|
|
// Used in _forms.scss to generate the form validation CSS for warnings, errors,
|
2014-03-10 07:18:48 +01:00
|
|
|
// and successes.
|
|
|
|
|
2015-08-26 10:30:30 +02:00
|
|
|
@mixin form-control-validation($color) {
|
2014-03-10 07:18:48 +01:00
|
|
|
// Color the label and help text
|
2016-02-09 10:10:05 +01:00
|
|
|
.form-control-feedback,
|
2015-08-25 09:12:18 +02:00
|
|
|
.form-control-label,
|
2016-10-29 01:35:47 +02:00
|
|
|
.col-form-label,
|
2016-09-05 20:39:37 +02:00
|
|
|
.form-check-label,
|
2016-02-09 08:21:32 +01:00
|
|
|
.custom-control {
|
2015-08-08 23:15:09 +02:00
|
|
|
color: $color;
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
2016-10-10 01:44:04 +02:00
|
|
|
|
2014-03-10 07:18:48 +01:00
|
|
|
// Set the border and box shadow on specific inputs to match
|
2017-02-05 02:03:42 +01:00
|
|
|
.form-control,
|
|
|
|
.custom-select,
|
|
|
|
.custom-file-control {
|
2015-08-08 23:15:09 +02:00
|
|
|
border-color: $color;
|
2014-12-02 23:02:35 +01:00
|
|
|
|
2016-10-20 22:35:45 +02:00
|
|
|
&:focus {
|
|
|
|
@include box-shadow($input-box-shadow, 0 0 6px lighten($color, 20%));
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
|
|
|
}
|
2015-08-08 23:15:09 +02:00
|
|
|
|
2014-03-10 07:18:48 +01:00
|
|
|
// Set validation states also for addons
|
|
|
|
.input-group-addon {
|
2015-08-08 23:15:09 +02:00
|
|
|
color: $color;
|
|
|
|
background-color: lighten($color, 40%);
|
2017-03-18 21:06:05 +01:00
|
|
|
border-color: $color;
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Form control focus state
|
|
|
|
//
|
|
|
|
// Generate a customized focus state and for any input with the specified color,
|
2017-04-17 00:45:10 +02:00
|
|
|
// which defaults to the `@input-border-color-focus` variable.
|
2014-03-10 07:18:48 +01: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 23:02:35 +01:00
|
|
|
@mixin form-control-focus() {
|
2014-03-10 07:18:48 +01:00
|
|
|
&:focus {
|
2016-03-02 17:41:20 +01:00
|
|
|
color: $input-color-focus;
|
|
|
|
background-color: $input-bg-focus;
|
2017-04-17 00:45:10 +02:00
|
|
|
border-color: $input-border-color-focus;
|
2015-04-23 10:10:14 +02:00
|
|
|
outline: none;
|
2016-09-12 07:32:33 +02:00
|
|
|
@include box-shadow($input-box-shadow-focus);
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
|
|
|
}
|