@import "mixins/mixins";
@import "common/var";

@include b(tag) {
  position: relative;
  height: 28px;
  padding: $--tag-padding;
  line-height: 28px;
  font-size: $--font-size-body-3;
  border-width: $--border-1;
  border-style: solid;
  // border-radius: $--tag-border-radius;
  border-radius: $--border-radius-small;
  box-sizing: border-box;
  font-weight: $--font-weight-400;
  white-space: nowrap;
  background-color: $--color-fill-3;
  border-color: transparent;
  color: $--color-text-1;
  display: inline-flex;
  align-items: center;

  @include e(content) {
    line-height: 22px;
    display: flex;
    align-items: center;
  }

  @include e(text) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 125px;
  }

  .el-icon-input-close {
    text-align: center;
    position: absolute;
    cursor: pointer;
    font-size: $--font-size-body-1;
    height: 12px;
    width: 12px;
    line-height: 12px;
    vertical-align: middle;
    top: 50%;
    transform: translateY(-50%);
    right: 8px;
    color: $--color-text-2;
    // border-radius: 50%;
    border-radius: $--border-radius-circle;

    &::before {
      display: block;
    }

    &:hover {
      background-color: $--tag-close-hover-background-color;
    }
  }

  .el-icon-checked {
    position: absolute;
    left: -3.5px;
    top: -3px;
    font-size: $--font-size-title-1;
    transform: scale(0.8);
  }
  .el-icon-plus {
    font-size: $--font-size-title-1;
  }
  @include when(notclosable) {
    padding: 0 8px;
  }

  @include e(icon) {
    margin-right: 4px;
    font-size: $--font-size-title-1;
  }

  @include when(disabled) {
    background-color: $--color-fill-3;
    color: $--color-text-4;

    &.is-hit {
      background-color: $--color-white;
      color: $--color-text-4;
    }
  }

  @include when(actived) {
    &:not(.is-disabled) {
      background-color: $--primary-6;
      border-color: $--primary-6;
      color: $--color-white;
    }
    &.is-actived-disabled {
      background-color: $--primary-3;
      border-color: $--primary-3;
      color: $--color-white;
    }
    & .el-tag__close{
      color: $--color-white;
    }
  }


  @include when(actived-hit) {
    &:not(.is-disabled) {
      background-color: $--color-white;
      border-color: $--primary-6;
      color: $--primary-6;
      border-width: $--border-1;
      border-style: solid;
    }
    &.is-hit-disabled {
      background-color: $--color-white;
      border-color: $--primary-3;
      color: $--primary-3;
      border-width: $--border-1;
      border-style: solid;
      cursor: not-allowed;
    }
  }

  @include when(wathet) {
    background-color: $--primary-1;
    color: $--primary-6;
    .el-tag__close {
      color: $--primary-6;
      &:hover {
        background-color: $--color-hover-info2;
    }
    }

    @include when(disabled) {
      background-color: $--primary-1;
      color: $--primary-3;
      //border-color: $--color-border-2;
      border: none;
    }
  }

  @include when(hit-wathet) {
    background-color: $--color-white;
    border-color: $--primary-6;
    color: $--primary-6;
    border-width: $--border-1;
    border-style: solid;
    .el-tag__close {
      color: $--primary-6;
      &:hover {
        background-color: $--primary-2;
      }
    }
  }

  @include m(medium) {
    height: 24px;
    line-height: 22px;
    font-size: $--font-size-body-1;
    .el-tag__text {
      max-width: 106px;
    }
  }

  @include m(small) {
    height: 20px;
    line-height: 18px;
    font-size: $--font-size-body-1;
    border-radius: $--border-radius-small;
    .el-tag__text {
      max-width: 106px;
    }
  }

  @include when(dashed) {
    border: $--border-1 dashed $--color-text-4;

    .el-input__inner {
      box-sizing: border-box;
      line-height: 26px;
      height: 28px;
      padding: 0 4px;
    }
    .el-input {
      width: 95px;
      margin-left: -8px;
    }
    &.el-tag--medium {
      .el-input__inner {
        line-height: 22px;
        height: 24px;
      }
    }
    &.el-tag--small {
      .el-input__inner {
        line-height: 18px;
        height: 20px;
      }
    }
  }

  @include when(edit) {
    cursor: pointer;
    &.is-notclosable:not(.is-disabled):not(.is-actived):not(.is-actived-hit):hover {
      background-color: $--border-color-light;
      border-color: $--border-color-light;
    }
    &.is-disabled {
      background-color: $--color-secondary;
      cursor: not-allowed;
    }
  }

  @include when(hit) {
    background-color: $--color-white;
    border-color: $--border-color-light;
    color: $--color-text-2;
    border-width: $--border-1;
    border-style: solid;

    &.is-notclosable:not(.is-disabled):not(.is-actived):not(.is-actived-hit):hover {
      background-color: $--color-fill-3;
      border-color: $--border-color-base;
    }
  }
  @include m(success) {
    background-color: $--success-1;
    color: $--success-6;
    .el-tag__close {
      color: $--success-6;
      &:hover {
        background-color: $--success-2;
    }
    }

  }

  @include m(danger) {
    background-color: $--danger-1;
    color: $--danger-6;
    .el-tag__close {
      color: $--danger-6;
      &:hover {
        background-color: $--danger-2;

    }
    }

  }

  @include m(info) {
    background-color: $--blue-1;
    color: $--blue-6;
    .el-tag__close {
      color: $--blue-6;
      &:hover {
        background-color: $--color-hover-info2;

    }
    }

  }

  @include m(warning) {
    background-color: $--warning-1;
    // color: $--warning-6;
    color: $--warning-6;
    .el-tag__close {
      color: $--warning-6;
      &:hover {
        background-color: $--color-hover-warning;

    }
    }

  }


  @include m(close) {
    background-color: $--background-color-close;
    color: $--color-text-3;
    .el-tag__close {
      color: $--color-text-3;
      &:hover {
        background-color: $--color-hover-close;
      }
    }

  }

  @include m(blueSea) {
    background-color: $--blue-1;
    color: $--blue-6;
    border: $--border-1 $--border-style-base $--blue-6;
  }

  @include m(darkPurple) {
    background: $--purple-1;
    border: $--border-1 $--border-style-base $--purple-6;
    color: $--purple-6;
  }

  @include m(twilight) {
    background: $--gold-1;
    border: $--border-1 $--border-style-base $--gold-6;
    color: $--gold-6;
  }
  @include m(blueness) {
    background: $--cyan-1;
    border: $--border-1 $--border-style-base $--cyan-6;
    color: $--cyan-6;
  }
  @include m(azaleine) {
    background-color: $--magenta-1;
    color: $--magenta-6;
    border: $--border-1 $--border-style-base $--magenta-6;
  }
  @include m(citrine) {
    background-color: $--yellow-1;
    color: $--yellow-6;
    border: $--border-1 $--border-style-base $--yellow-6;
  }
  @include m(youthfulPurple) {
    background-color: $--pinkpurple-1;
    color: $--pinkpurple-6;
    border: $--border-1 $--border-style-base $--pinkpurple-6;
  }
  @include m(lateAutumn) {
    background-color: $--orangered-1;
    color: $--orangered-6;
    border: $--border-1 $--border-style-base $--orangered-6;
  }
  @include m(newGreen) {
    background-color: $--lime-1;
    color: $--lime-6;
    border: $--border-1 $--border-style-base $--lime-6;
  }
  @include m(primarycolor) {
    background-color: $--primary-1;
    color: $--primary-6;
    border: $--border-1 $--border-style-base $--primary-6;
  }
  @include m(successcolor) {
    background-color: $--background-color-success;
    color: $--success-6;
    border: $--border-1 $--border-style-base $--success-6;
  }
  @include m(warningcolor) {
    background-color: $--background-color-warning;
    color: $--warning-6;
    border: $--border-1 $--border-style-base $--warning-6;
  }
  @include m(dangercolor) {
    background-color: $--background-color-danger;
    color: $--danger-6;
    border: $--border-1 $--border-style-base $--danger-6;
  }

}
.tag-item + .el-tag {
  margin-left: 12px !important;
}
.button-new-tag {
  display: inline-block;
  text-align: center;
  line-height: 22px;
  width: 92px ;
  height: 26px ;
  background: $--color-fill-3 ;
  // border-radius: 4px ;
  border-radius: $--border-radius-medium;
  color: $--color-text-1 ;
  border: $--border-1 dashed $--color-border-4 ;
  .el-icon-plus{

    color: #4E5969;
    font-size: $--font-size-title-1;
  }

}
.input-new-tag {
  width: 90px !important;
  margin-left: 10px !important;
  vertical-align: bottom;
}
