// Base class
//
// Requires one of the contextual, color modifier classes for `color` and
// `background-color`.

.#{$badge-prefix-cls} {
  display: inline-block;
  padding: 0 $badge-padding-x;
  font-size: $badge-font-size;
  font-weight: $badge-font-weight;
  line-height: $badge-height;
  //min-width: $badge-height;
  color: $badge-color;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  @include border-radius($badge-height);
  background-color: $badge-default-bg;

  // Empty badges collapse automatically
  //&:empty {
  //  display: none;
  //}
}

a.#{$badge-prefix-cls} {
  @include hover-focus {
    color: $badge-link-hover-color;
    background-color: darken($badge-default-bg, 10%);
  }
}

// Quick fix for badges in buttons
.#{$btn-prefix-cls} .#{$badge-prefix-cls} {
  position: relative;
  top: -1px;
}

// Pill badges
//
// Make them extra rounded with a modifier to replace v3's badges.

//.badge-pill {
//  padding-right: $badge-pill-padding-x;
//  padding-left: $badge-pill-padding-x;
//  @include border-radius($badge-pill-border-radius);
//}

//dot badges
.#{$badge-prefix-cls}--dot{
  font-size:0;
  padding:0;
  position: absolute;
  transform: translateX(50%);
  top: -$badge-dot-height/2;
  right: 0;
  height: $badge-dot-height;
  width: $badge-dot-width;
  border-radius: 100%;
  border:1px solid $white;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.10);
}

//定位在顶部
.#{$badge-prefix-cls}--top{
  position: absolute;
  transform: translateX(50%);
  top: -$badge-height/2;
  right: 0;
}

// Colors
//
// Contextual variations (linked badges get darker on :hover).

@each $key, $value in $color-status{
  .#{$badge-prefix-cls}.#{$badge-prefix-cls}--#{$key} {
    @extend %gradient-#{nth($value,1)};
  }
  // scss-lint:disable QualifyingElement
  // Add hover effects, but only for links
  a.#{$badge-prefix-cls}--#{$key}{
    @include hover-focus{
      color: $badge-link-hover-color;
      text-decoration: none;
      @include hover-gradient(nth($value,2),nth($value,3));
    }
  }
}

.#{$badge-prefix-cls}.#{$badge-prefix-cls}--dark {
  background-color: $gray-darker;
}

a.#{$badge-prefix-cls}--dark {
  @include hover-focus {
    color: $badge-link-hover-color;
    text-decoration: none;
    background-color: darken($gray-darker, 10%);
  }
}

.#{$badge-prefix-cls}.#{$badge-prefix-cls}--muted {
  color: $gray;
  background-color: $gray-lightest-18;
}

a.#{$badge-prefix-cls}--muted {
  @include hover-focus {
    color: $gray;
    text-decoration: none;
    background-color: darken($gray-lightest-18, 10%);
  }
}


