@import "../common/var";
@import "mixins";

@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) {
  padding: $padding-vertical  $padding-horizontal ;
  font-size: $font-size;
  border-radius: $border-radius;
  @include pf(round) {
    padding: $padding-vertical $padding-horizontal;
  }
  @include pf(circle) {
    padding: $padding-vertical;
  }

}

@mixin button-variant($color,$background-color,$border-color) {
  color: $color;
  background-color: $background-color;
  border-color: $border-color;

  &:hover {
    color: $color;
    background-color: mix($color-white, $background-color, $button-hover-hybrid-percent);
    border-color: mix($color-white, $border-color, $button-hover-hybrid-percent);
  }
  &:active {
    color: $color;
    outline: none;
    background-color: mix($color-black, $background-color, $button-active-hybrid-percent);
  }
  @include pf(text) {
    @include button-text($background-color);
  }
  @include pf(simple) {
    @include button-simple($background-color)
  }
  @include pf(disabled) {
    &, &:hover, &:active {
      color: $color-white;
      border-color: mix($border-color, $color-white);
      background-color: mix($background-color, $color-white);
    }
    @include pf(text) {
      &, &:hover, &:active {
        color: mix($background-color, $color-white);
        background-color: $button-disabled-bg-color;
      }
    }
   @include pf(simple) {
      &, &:hover, &:active {
        color: mix($background-color, $color-white);
        border-color: mix($border-color, $color-white, 20%);
        background-color: mix($background-color, $color-white, 10%);
      }
    }

  }
}


//text按钮（非默认样式）
@mixin button-text($color) {
  color: $color;
  background-color: unset;
  border: 0;
  &:hover {
    background-color: rgba($color, $button-bg-clarity-1);
    border-color: rgba($color, $button-bg-clarity-1);
  }
  &:active {
    outline: none;
    background-color: rgba($color, $button-bg-clarity-2);
    border-color: rgba($color, $button-bg-clarity-2);
  }

}

//simple按钮（非默认样式）
@mixin button-simple($color) {
  color: $color;
  background-color: mix($color-white, $color, 90%);
  border-color: mix($color-white, $color, 60%);
  &:hover {
    background-color: $color;
    border-color: $color;
    color: $color-white;
  }
  &:active {
    outline: none;
    background-color: mix($color-black, $color, $button-active-hybrid-percent);
    border-color: mix($color-black, $color, $button-active-hybrid-percent);
  }
}
