.ui-tag {
  align-items: center;
  border-radius: 1.5em;
  display: inline-grid;
  font-size: 0.8em;
  grid-template-areas: "avatar label value close";
  line-height: 1;
  margin: 0.25rem;
  overflow: hidden;
  vertical-align: middle;

  &__icon,
  &__label,
  &__avatar {
    vertical-align: middle;
  }

  &__icon {
    grid-area: avatar;
    padding-left: 0.25rem;

    &:empty {
      display: none;
    }

    img {
      border-radius: 50%;
      height: 1.5em;
      margin: 0.15em;
      overflow: hidden;
      width: 1.5em;
    }

    .ui-icon {
      border-radius: 1em;
      font-size: 1.5em;
      margin: 0;
      overflow: hidden;
      padding: 0.125em;
    }
    .ui-flag {
      border-radius: 1em;
      box-shadow: none;
      font-size: 1.5em;
      height: 1em;
      margin: 0.125em;
      max-height: 1em;
      overflow: hidden;
      width: 1em;
    }
  }

  &__label {
    grid-area: label;
    padding: 0.42em 0.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &:empty {
      display: none;
    }

    &:not(:empty) ~ &__value {
      padding: 0.42em 0.5em;
    }

    &:not(:empty) + &__icon {
      border-radius: 0;
    }
  }

  &__value {
    grid-area: value;
    padding: 0.42em 1em;

    &:empty {
      display: none;
    }
  }

  &__close {
    align-self: center;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: $font-weight-light;
    grid-area: close;
    line-height: 1;
    opacity: 0.75;
    padding: 0 0.2em;

    &:hover {
      opacity: 0.9;
    }
  }

  &--md {
    font-size: 1em;
  }
  &--lg {
    font-size: 1.2em;
  }
}
