// Button variants
//
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons

@mixin button-variant(
  $color,
  $background,
  $border,
  $hover-background,
  $btn-hover-box-shadow,
  $active-background,
  $btn-disabled-color,
  $btn-disabled-bg,
  $btn-disabled-border,
  $hover-color,
  $hover-border,
  $active-color,
  $active-border
) {
  color: $color;
  background-color: $background;
  border-color: $border;

  &:hover {
    color: $hover-color;
    background-color: $hover-background;
    border-color: $hover-border;
    // box-shadow: $btn-hover-box-shadow;
    .btn-loading-circle {
      .btn-loading-addon {
        border-top-color: $hover-color;
        border-right-color: $hover-color;
        border-bottom-color: $hover-color;
      }
    }
  }

  &:active,
  .open > &.dropdown-toggle {
    color: $active-color;
    background-color: $active-background;
    background-image: none;
    border-color: $active-border;
    box-shadow: none;
  }

  &.disabled,
  &:disabled {
    color: $btn-disabled-color;
    background-color: $btn-disabled-bg;
    border-color: $btn-disabled-border;

    &:hover {
      color: $btn-disabled-color;
      background-color: $btn-disabled-bg;
      border-color: $btn-disabled-border;
    }
  }
  .btn-loading-circle {
    .btn-loading-addon {
      border: $loading-circle-line-height solid $color;
      border-left-color: transparent;
      border-radius: 100%;
      vertical-align: text-bottom;
      animation: spinner $loading-circle-animation-duration linear infinite;
    }

    .btn-loading-message {
      color: inherit;
      margin-top: $loading-circle-height * 0.5 + rem(16px);
    }
  }
  .dada-ico {
    transition: transform 0.2s ease;
  }
}

// Button sizes
@mixin button-size($padding-y, $padding-x, $font-size, $line-height) {
  padding: $padding-y $padding-x;
  font-size: $font-size;
  line-height: $line-height;
  .btn-loading-circle {
    .btn-loading-addon {
      display: inline-block;
      width: $font-size;
      height: $font-size;
    }

    .btn-loading-message {
      margin-top: $loading-circle-height * 0.5 + rem(16px);
    }
  }
}

// icon button size
@mixin button-icon-size($padding, $size) {
  padding: $padding;
  font-size: $size;
  line-height: $size;
  .btn-loading-circle {
    .btn-loading-addon {
      vertical-align: initial;
    }
  }
}
