@import '../../_style/index.less';

@mdfButtonPrefixCls: mdf-button;

.mdf-button-color(@color; @background; @border) {
  color: @color;
  background: @background;
  .hairline('all', @border, @button-height-sm*0.5);
}

.mdf-button-variant(@color; @background; @border) {
  .mdf-button-color(@color; @background; @border);

  &.@{mdfButtonPrefixCls}-active { // tap
      .mdf-button-color(darken(@color, 10%); darken(@background, 10%); @border);
  }
  &.@{mdfButtonPrefixCls}-disabled { // disabled
    opacity: .4;
  }
  &.@{mdfButtonPrefixCls}-visible { // disabled
    display: none;
  }
  &:hover{
    color: @color;
  }
}

.@{mdfButtonPrefixCls} {
  // base
  display: block;
  outline: 0 none;
  -webkit-appearance: none;
  box-sizing: border-box;
  padding: 0 10*@hd;
  text-align: center;
  font-size: @button-font-size;
  height: @button-height;
  border-radius: @button-height*0.5;
  line-height: @button-height;
  overflow: initial;
  text-overflow: ellipsis;
  word-break: break-word;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  // default
  color: @color-text-base;
  background-color: @fill-base;
  // .hairline('all', @border-color-base, @radius-md);

  &-default {
    .mdf-button-variant(@color-text-base; @fill-base; @border-color-base);
  }

  &-toolbar-default{
    .mdf-button-variant(@color-text-base; @toolbars-next-btn; @toolbars-next-btn);
  }

  &-toolbar-primary,
  &-primary {
    .mdf-button-variant(@color-text-base-inverse; @primary-button-fill; @primary-button-fill);
    background: linear-gradient(45deg, #FC4C2F 0%, #EE2233 100%);
  }
  &-warning {
    .mdf-button-variant(@warning-button-text-color; @warning-button-fill; @border-color-base);
  }
  &-ghost {
    .mdf-button-variant(@warning-button-text-color; @fill-base; @primary-button-fill);
  }
  &-text {
    .mdf-button-variant(@warning-button-text-color; transparent; transparent);
  }
  &-large {
    width: 100%;
  }
  &-inline {
    display: inline-block;
    padding: 0 @h-spacing-lg;
    width: auto;
    &.@{mdfButtonPrefixCls}-icon {
      display: inline-flex;
    }
  }
  &-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  > .@{mdfButtonPrefixCls}-icon {
    margin: 0.3em;
  }
  &-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: @button-font-size-sm;
    height: @button-height-sm;
    min-width: 80*@hd;
    line-height: @button-height-sm;
    // padding: 0 21 * @hd;
    border-radius: @button-height-sm*0.5;
    &.@{mdfButtonPrefixCls}-active { // tap
      border-radius: @button-height-sm*0.5;
    }
  }
  &-large-column {
    flex-direction: column;
    height: @button-height*1.5;
    line-height: @button-height*0.5;

    div {
      display: flex;
      justify-content: center;
    }
  }
  &-small-column {
    flex-direction: column;
    height: @button-height-sm*1.5;
    line-height: @button-height-sm*0.5;

    div {
      display: flex;
      justify-content: center;
    }
  }
}
