.button--icon-text {
  @include font-style;
  @include text-ellipsis;
  color: $color-brand--one;
  cursor: pointer;
  font-family: $font-family-theme;
  padding: 0;
  position: relative;

  &,
  &:hover {
    align-items: center;
    background: none;
    border: 0;
    display: inline-flex;
    height: $baseline * 4;
    margin-left: -10px; // compensate for initial scale on icon
    line-height: normal;
    outline: none;
    overflow: visible;
  }

  // on touch devices hover is similar to ':active' state.
  // outputs regular ':active' state & specific ':hover'
  // state for touch devices
  & {
    @include hover-touch {
      background: none;
      border-color: none;
    }
  }

  .icon {
    position: relative;
    transform: scale(0.667); // load bigger icon initially for smoother animation
    // selector chained to add specificity over defaults
    &.icon,
    &.icon:hover {
      color: currentColor;
    }
  }

  .bg-brand--blue &,
  .bg-brand--dark-blue &,
  .bg-brand--turquoise &,
  .bg-brand--red & {
    color: $color-brand--four;
  }

  .bg-brand--yellow & {
    color: $color-brand--two;
  }
}

.content-block .button--icon-text {
  margin-top: $spacing--m;
  vertical-align: middle;
}

// viewport l
@include viewport--l {
  .button--icon-text {
    .bg-brand--yellow &,
    .bg-brand--white &,
    .bg-brand--off-white & {
      color: $color-brand--four;
    }

  .text--dark-from-l & {
    color: $color-brand--two;
  }

    &:hover .icon {
      @include animation-pulse('pulse', 0.667, 0.72);
      animation: pulse 1s infinite ease-out;
    }
    // disable animation for touch devices
    @include hover-touch {
      .icon {
        animation: none;
      }
    }
  }
}
