@import '../style/var.less';

.van-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  .theme(padding, '@tag-padding');
  .theme(color, '@tag-text-color');
  .theme(font-size, '@tag-font-size');
  .theme(line-height, '@tag-line-height');
  .theme(border-radius, '@tag-border-radius');

  &--default {
    .theme(background-color, '@tag-default-color');

    &.van-tag--plain {
      .theme(color, '@tag-default-color');
    }
  }

  &--danger {
    .theme(background-color, '@tag-danger-color');

    &.van-tag--plain {
      .theme(color, '@tag-danger-color');
    }
  }

  &--primary {
    .theme(background-color, '@tag-primary-color');

    &.van-tag--plain {
      .theme(color, '@tag-primary-color');
    }
  }

  &--success {
    .theme(background-color, '@tag-success-color');

    &.van-tag--plain {
      .theme(color, '@tag-success-color');
    }
  }

  &--warning {
    .theme(background-color, '@tag-warning-color');

    &.van-tag--plain {
      .theme(color, '@tag-warning-color');
    }
  }

  &--plain {
    .theme(background-color, '@tag-plain-background-color');

    &::before {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      border: 2px solid currentcolor;
      border-radius: inherit;
      content: '';
      pointer-events: none;
    }
  }

  &--medium {
    .theme(padding, '@tag-medium-padding');
  }

  &--large {
    .theme(padding, '@tag-large-padding');
    .theme(font-size, '@tag-large-font-size');
    .theme(border-radius, '@tag-large-border-radius');
  }

  &--mark {
    .theme(
        border-radius,
        '0 @tag-round-border-radius @tag-round-border-radius 0'
      );

    &::after {
      display: block;
      width: 4px;
      content: '';
    }
  }

  &--round {
    .theme(border-radius, '@tag-round-border-radius');
  }

  &__close {
    min-width: 1em;
    margin-left: 4px;
  }
}
