@import "../common/var";
/* @mixin button-plain($color) {
  color: $color;
  background: mix($--color-white, $color, 100%);
  border-color: $color;

  &:hover {
    background: $color;
    border-color: $color;
    color: $--color-white;
  }

  &:active {
    background: mix($--color-black, $color, $--button-active-shade-percent);
    border-color: mix($--color-black, $color, $--button-active-shade-percent);
    color: $--color-white;
    outline: none;
  }

  &.is-disabled {
    &,
    &:hover,
    &:active {
      color: mix($--color-white, $color, 40%);
      background-color: mix($--color-white, $color, 90%);
      border-color: mix($--color-white, $color, 80%);
    }
  }
} */
/* 次要按钮的样式改动 by hcy 2019-12-12 */
@mixin button-plain2($color, $background-color, $border-color) {
  color: $background-color;
  background: mix($--color-white, $background-color, 100%);
  border-color: $background-color;

  &:not(.is-disabled):hover {
    background: mix($--color-white, $background-color, 90%);
    border-color: mix($--color-white, $border-color, $--button-hover-tint-percent);
    color: mix($--color-white, $border-color, $--button-hover-tint-percent);
  }
  
  &:not(.is-disabled):active {
    background: mix($--color-white, $background-color, 90%);
    /* border-color: $--color-primary-dark;
    color: $--color-primary-dark; */
    border-color: mix($--color-black, $border-color, $--button-active-shade-percent);
    color: mix($--color-black, $border-color, $--button-active-shade-percent);
    outline: none;
  }

  /* &.is-disabled {
    &,
    &:hover,
    &:active {
      color: $--button-disabled-color;
      cursor: not-allowed;
      background-image: none;
      background-color: $--button-disabled-fill;
      border-color: $--button-disabled-border;
    }
  } */
}

@mixin button-variant($color, $background-color, $border-color) {
  color: $color;
  background-color: $background-color;
  border-color: $border-color;

  &:not(.is-disabled):hover {
    background: mix($--color-white, $background-color, $--button-hover-tint-percent);
    border-color: mix($--color-white, $border-color, $--button-hover-tint-percent);
    color: $color;
  }
  
  &:not(.is-disabled):active {
    background: mix($--color-black, $background-color, $--button-active-shade-percent);
    border-color: mix($--color-black, $border-color, $--button-active-shade-percent);
    color: $color;
    outline: none;
  }

  &.is-active {
    background: mix($--color-black, $background-color, $--button-active-shade-percent);
    border-color: mix($--color-black, $border-color, $--button-active-shade-percent);
    color: $color;
  }

  /* &.is-disabled {
    &,
    &:hover,
    &:active {
      color: $--color-white;
      background-color: mix($background-color, $--color-white);
      border-color: mix($border-color, $--color-white);
    }
  } */

  &.is-plain {
    /* @include button-plain($background-color); */
    @include button-plain2($color, $background-color, $border-color);
  }
  &.is-text {
    border-color: transparent;
    color: $background-color;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    &:hover{
      color: mix($--color-white, $background-color, $--button-hover-tint-percent);
      border-color: transparent;
      background-color: transparent;
    }
    &:active {
      color: mix($--color-black, $background-color, $--button-active-shade-percent);
      border-color: transparent;
      background-color: transparent;
    }
    &.is-disabled,
    &.is-disabled:hover{
      color: $--color-text-disabled;
      border-color: transparent;
    }
  }
}

@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $border-radius, $line-height, $--button-icon-padding, $--button-icon-mini-padding) {
  padding: $padding-vertical $padding-horizontal;
  font-size: $font-size;
  border-radius: $border-radius;
  &.is-round {
    padding: $padding-vertical $padding-horizontal;
  }
  &.is-circle {
    padding: $padding-vertical;
  }
  &.is-icon-button {
    padding: $--button-icon-padding;
  }
  &.is-icon-button-mini {
    padding: $--button-icon-mini-padding;
    line-height: 1;
  }
}
