/*
 * Copyright 2015-2016 Imply Data, Inc.
 * Copyright 2017-2019 Allegro.pl
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

%button-base {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  min-width: 60px;
  text-align: center;
  cursor: pointer;
  border-radius: 2px;
  outline: none;
  height: $input-height;

  //transition-property: all;
  //transition-duration: $duration;

  // sass-lint:disable no-empty-rulesets
  &.active,
  &:active {
    //transition-duration: 0s;
  }
  // sass-lint:enable no-empty-rulesets

  &.disabled,
  &[disabled] {
    opacity: .60;
    cursor: default;
    pointer-events: none;
  }
}

%button-primary {
  @extend %button-base;
  @include css-variable(background-color, brand);
  color: $white;

  svg path {
    fill: $white;
  }

  &:hover {
    @include css-variable(background-color, button-primary-hover);
  }

  &.active,
  &:active {
    @include css-variable(background-color, button-primary-active);
    color: darken($white, 12%);

    svg path {
      fill: darken($white, 12%);
    }
  }
}

%button-secondary {
  @extend %button-base;
  @include css-variable(color, brand);
  @include css-variable(background-color, button-secondary);

  svg path {
    @include css-variable(fill, brand);
  }

  &:hover {
    @include css-variable(background-color, button-secondary-hover);
  }

  &.active,
  &:active {
    @include css-variable(background-color, button-secondary-active);
  }
}

%button-warn {
  @extend %button-base;
  @include css-variable(background-color, button-warn);
  color: $white;

  svg path {
    fill: $white;
  }

  &:hover {
    @include css-variable(background-color, button-warn-hover);
  }

  &.active,
  &:active {
    @include css-variable(background-color, button-warn-active);
    color: darken($white, 12%);

    svg path {
      fill: darken($white, 12%);
    }
  }
}

%button-light {
  @include css-variable(color, text-standard);
  background-color: transparent;
  cursor: pointer;

  &:hover {
    @include css-variable(background-color, hover);
  }

  &.active {
    @include css-variable(background-color, highlight);
  }
}
