// Form validation states
//
// Used in _forms.scss to generate the form validation CSS for warnings, errors,
// and successes.

@mixin form-control-validation($color) {
  // Color the label and help text
  .#{$form-prefix-cls}-feedback {
    color: $color;
  }

  // Set the border and box shadow on specific inputs to match
  .#{$input-prefix-cls},
  .#{$select-prefix-cls}.#{$select-prefix-cls} .#{$select-prefix-cls}__selection {
    border-color: $color;
    @include hover {
      border-color:$color;
    }
    &:focus {
      border-color:$color;
      @include box-shadow(inset 0 0 0 2px rgba($color, 0.3));
    }
  }

  .#{$select-prefix-cls}--open .#{$select-prefix-cls}__selection,
  .#{$select-prefix-cls}--focus .#{$select-prefix-cls}__selection {
    @include box-shadow(inset 0 0 0 2px rgba($color, 0.3));
    .#{$select-prefix-cls}__input:focus {
      box-shadow: none;
    }
  }

  // Set validation states also for addons
  .input-group-addon {
    color: $color;
    background-color: lighten($color, 40%);
    border-color: $color;
  }
}



//
// form-size
//

@mixin form-size($size){
  .#{$input-prefix-cls}{
    @extend .#{$input-prefix-cls}--#{$size};
  }
  .input-group{
    @extend .input-group--#{$size};
  }
  .form-radio{
    @extend .form-radio--#{$size};
  }
  .#{$checkbox-prefix-cls}{
    @extend  .#{$checkbox-prefix-cls}--#{$size};
  }
  .switch{
    @extend .switch--#{$size};
  }
  .slider{
    @extend  .slider--#{$size};
  }
  .form-input-number{
    @extend  .form-input-number--#{$size};
  }
  .select{
    @extend .select--#{$size};
  }
  .#{$btn-prefix-cls}{
    @extend .#{$btn-prefix-cls}-#{$size};
  }
  textarea.#{$input-prefix-cls}{
    height:auto;
    line-height: $line-height-base;
    padding:$input-padding-y $input-padding-x;
  }
}
