// Core input mixins
@import '../mixins';

// Core Button Mixins
// -----------------------------------------------------------------------------

// Clears browser default button styling
@mixin reset-button() {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;

  &:active,
  &.is-active {
    box-shadow: none;
  }

  &:active:focus,
  &.is-active:focus,
  &.active:focus { // TODO: see if we can get ember to use is-active instead
    outline: none;
  }
}

@mixin button-type($text-color, $background-color, $border-color) {
  color: $text-color;
  background-color: $background-color;
  border-color: $border-color;

  // TODO: remove dropdown-toggle after dropdown refactor
  &:hover {
    color: ice-adjust-color($text-color, -$button-hover-color-inc);
    background-color: ice-adjust-color($background-color, $button-hover-color-inc);
    border-color: ice-adjust-color($border-color, -$button-hover-color-inc);
  }

  &[disabled],
  fieldset[disabled] & { // we may decide to change fieldset to a class
    @include disabled-input();
    color: ice-adjust-color($text-color, $button-disabled-color-inc);
    background-color: ice-adjust-color($background-color, $button-disabled-color-inc);
    border-color: ice-adjust-color($border-color, $button-disabled-color-inc);
  }

  // Pressed state
  &:active,
  &.is-active, // the .is-active class is to be used when the button needs to be manually pressed, like for dropdowns
  .open &.dropdown-toggle { // TODO: remove this once dropdowns are replaced in iverson
    color: ice-adjust-color($text-color, -$button-pressed-color-inc);
    background-color: ice-adjust-color($background-color, -$button-pressed-color-inc);
    border-color: ice-adjust-color($border-color, -$button-pressed-color-inc);
  }
}
