/// Add other styles properties for Rocketbelt buttons such as width, background, color, and fill.
///
/// @group Buttons
/// @author Kendrick Arnett
///
/// @param $style [primary] - The type of button to render properties for.
@mixin button-style($style: primary) {
  $button-base: color(primary);
  $button-hover: scale-color($button-base, $lightness: 12.5%);
  $button-active: $button-hover;

  $button-base-secondary: color(primary);
  $button-hover-secondary: scale-color($button-base, $lightness: 12.5%);
  $button-active-secondary: color(primary);

  @if $style == dynamic {
    position: relative;
    filter: none;
    transition: background 150ms linear, background-image 150ms linear;

    &.button-state-with-text {
      display: inline-flex;
      white-space: nowrap;

      align-items: center;
      justify-content: center;

      .button-state-text {
        visibility: visible;
        flex: 1 0 auto;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .button-state-icon {
        position: relative;
        top: auto;
        left: auto;
        flex: 0 0 1em;
        margin-left: 1em;
        width: auto;
        transform: none;
      }
    }
  } @else if $style == busy {
    .button-state-text {
      visibility: hidden;
    }

    .button-state-icon {
      $color-fill: quote(color(white));
      position: absolute;
      top: 31%;
      left: 42%;
      width: 1em;
      height: 1em;
      background-image: svg-url(
        '<svg width="11" height="19" viewBox="190 45 11 19" fill="#{$color-fill}" xmlns="http://www.w3.org/2000/svg"><path d="M201 45v2c-4.962 0-9 4.038-9 9 0 2.48 1.01 4.73 2.64 6.36l-1.415 1.415C191.24 61.795 190 59.04 190 56c0-6.065 4.935-11 11-11z" fill-rule="evenodd"/></svg>'
      );
      background-size: contain;
      background-repeat: no-repeat;
      transform: translate(-50%, -50%);
      animation: spin 1s cubic-bezier(0.78, 0.38, 0.49, 0.88) infinite;
    }
  } @else if $style == success {
    background: color(success);
    border-color: color(success);
    background-image: none;
    transition: background 150ms linear, background-image 150ms linear;

    .button-state-text {
      visibility: hidden;
    }

    .button-state-icon {
      $color-fill: quote(color(white));
      position: absolute;
      top: 50%;
      left: 50%;
      width: 1.5em;
      height: 1.5em;
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg aria-labelledby='aprb-icon-check-desc aprb-icon-check-title' xmlns='http://www.w3.org/2000/svg' style='fill: white%3B' viewBox='0 0 16 16'%3E%3Ctitle id='aprb-icon-check-title'%3ECheck%3C/title%3E%3Cdesc id='aprb-icon-check-desc'%3EA check mark%3C/desc%3E%3Cpath d='M5.417 13a.44.44 0 01-.317-.134L1.129 8.782a.457.457 0 01.003-.64.441.441 0 01.63.005l3.66 3.763 8.821-8.78a.439.439 0 01.63.006.456.456 0 01-.006.638l-9.138 9.097a.439.439 0 01-.312.129' fill-rule='evenodd'/%3E%3C/svg%3E");
      background-position: center center;
      background-size: contain;
      background-repeat: no-repeat;
      transform: translate(-50%, -50%);
    }

    &[disabled] {
      opacity: 1;
      filter: none;

      &:hover {
        background: color(success);
      }
    }

    &:hover {
      background: color(success);
    }
  }
}
