@import '../../../scss/styles.scss';

.pill {
  font-size: 1rem;
  line-height: base(1);
  display: inline-flex;
  background: var(--theme-elevation-150);
  color: var(--theme-elevation-800);
  border-radius: $style-radius-s;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  padding: 0 base(.25);
  align-items: center;

  &:active,
  &:focus {
    outline: none;
  }

  &--has-action {
    cursor: pointer;
    text-decoration: none;
  }

  &--is-dragging {
    cursor: grabbing;
  }

  &--has-icon {
    svg {
      display: block;
    }
  }

  &--align-icon-left {
    padding-left: 0;
  }

  &--align-icon-right {
    padding-right: 0;
  }

  &--style-white {
    background: var(--theme-elevation-0);

    &.pill--has-action {
      &:hover {
        background: var(--theme-elevation-100);
      }

      &:active {
        background: var(--theme-elevation-100);
      }
    }
  }

  &--style-light {
    &.pill--has-action {
      &:hover {
        background: var(--theme-elevation-100);
      }

      &:active {
        background: var(--theme-elevation-100);
      }
    }
  }

  &--style-light-gray {
    background: var(--theme-elevation-100);
    color: var(--theme-elevation-800);
  }

  &--style-warning {
    background: var(--theme-warning-500);
  }

  &--style-success {
    background: var(--theme-success-500);
    color: var(--color-base-800);
  }

  &--style-dark {
    background: var(--theme-elevation-800);
    color: var(--theme-elevation-0);

    svg {
      @include color-svg(var(--theme-elevation-0));
    }

    &.pill--has-action {
      &:hover {
        background: var(--theme-elevation-750);
      }

      &:active {
        background: var(--theme-elevation-700);
      }
    }
  }
}
