@import "./token.less";

@tag-cls: ~"@{prefix}-tag";

.@{tag-cls} {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  max-width: 180px;
  box-sizing: border-box;
  height: 24px;
  border-radius: 4px;
  padding: 4px 8px;
  .no-select;

  &-icon {
    .bp-icon {
      width: 12px !important;
      height: 12px !important;
      margin-right: 2px;
    }
  }

  &-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
  }

  &-inner {
    font-size: 12px;
    font-weight: 400;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
  }

  .bp-icon-close-line {
    fill: @gary-7;
    margin-left: 4px;
    cursor: pointer;
    padding: 1px;
    border-radius: 10px;
    transition: all 0.2s ease;

    &:hover {
      color: @gary-8;
      background-color: @gary-4;
      transition: all 0.2s ease;
    }
  }
}

.@{tag-cls}-dot-box {
  background-color: none;
  padding: 4px 0;
}

.tag-status(@status) {
  .@{tag-cls}-@{status} {
    background-color: ~"@{tag-status-@{status}-background}";

    .@{tag-cls}-icon {
      .bp-icon {
        fill: ~"@{tag-status-@{status}-font-color}";
      }
    }

    .@{tag-cls}-inner {
      color: ~"@{tag-status-@{status}-font-color}";
    }
  }
}

.tag-status-dot(@status) {
  .@{tag-cls}-dot-@{status} {
    background-color: ~"@{tag-status-@{status}-background-dot}";

    .@{tag-cls}-icon {
      .bp-icon {
        fill: @gary-8;
      }
    }

    .@{tag-cls}-inner {
      color: @gary-8;
    }
  }
}

.tag-status(normal);
.tag-status(primary);
.tag-status(success);
.tag-status(warning);
.tag-status(danger);

.tag-status-dot(normal);
.tag-status-dot(primary);
.tag-status-dot(success);
.tag-status-dot(warning);
.tag-status-dot(danger);
