/* Buttons */

%button {
  @include button(normal);
  &:focus { @include button(focus); }
  &:hover { @include button(hover); }
  &:active { @include button(active); }
  &:insensitive { @include button(insensitive); }
}

%flat_button {
  @include button(flat-normal);
  &:focus { @include button(flat-focus); }
  &:hover { @include button(flat-hover); }
  &:active { @include button(flat-active); }
  &:insensitive { @include button(flat-insensitive); }
}

// buttons on OSD elements
// that are undecorated by default and use OSD colors
%osd_button {
  @include button(flat-normal, $tc:on($osd));
  &:insensitive { @include button(insensitive, $tc:on($osd), $bc:$osd); }
  &:focus { @include button(focus, $tc:on($osd), $bc:$osd);}
  &:hover { @include button(hover, $tc:on($osd), $bc:$osd);}
  &:active { @include button(active, $tc:on($osd), $bc:$osd);}
  &:outlined, &:checked { @include button(checked, $tc:on($osd), $bc:$osd);}
}

.button {
  min-height: 20px;
  padding: $base_padding $base_padding * 2;
  border-radius: $base_radius;
  border: none;
  @extend %button;

  @if $colorful == 'true' {
    &:active {
      background-color: $primary;
      color: on($primary);
    }
  }

  .popup-menu & {
    @extend %flat_button;

    @if $colorful == 'true' {
      &:active {
        background-color: $primary;
        color: on($primary);
      }
    }
  }
}

.icon-button {
  border-radius: $circular_radius;
  padding: $base_padding;
  @extend %button; // same style as buttons
  background-color: $fill;

  @if $colorful == 'true' {
    &:active {
      background-color: $primary;
      color: on($primary);
    }
  }

  StIcon {
    icon-size: $base_icon_size !important;
    -st-icon-style: symbolic;
  }
}
