.badge {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.badge-addon {
  position: absolute;
  right: 0;
  top: 0;
  border-radius: $badge-min-width;
  color: $badge-color;
  border: 1px solid white;
  text-align: center;
  white-space: nowrap;
  box-shadow: $badge-box-shadow;
  padding: $badge-padding;
  font-size: $badge-font-size;
  transform: translateX(50%) translateY(-50%);

  &:not(:empty) {
    min-width: $badge-min-width;
  }
}

//徽章类型
.badge-legend {
  margin-right: $badge-legend-margin-right;

  .badge-addon {
    position: static;
    display: inline-block;
    margin-right: $badge-legend-addon-margin-right;
    vertical-align: sub;
  }
}

// addon size
.badge-addon-sm {
  top: -1px;
  right: -1px;
  border: 0;
  padding: 0;
  font-size: $badge-font-size-sm;

  &:not(:empty) {
    min-width: $badge-min-width-sm;
  }
}
