// Button variants
//
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons

@mixin button-variant($config: (color, background, edge-color)) {
  $background-bottom:       darken(map-get($config, background), 4%);

  $background-hover:        lighten(map-get($config, background), $btn-hover-darkness);
  $background-active:       darken(map-get($config, background), $btn-hover-darkness);


  background-color: map-get($config, background);
  @include gradient-vertical(map-get($config, background), $background-bottom);

  border-bottom-color: map-get($config, edge-color);

  color: map-get($config, color);

  &:hover,
  &:focus,
  &:active,
  &.active,
  .open > &.dropdown-toggle {
    color: map-get($config, color);
    background-image: none;
  }

  &:hover,
  &:focus {
    background-color: $background-hover;
  }

  &:active,
  &.active,
  .open > &.dropdown-toggle {
    background-color: $background-active;
    outline: none;
  }

  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active,
    &.active {
      @include gradient-vertical(map-get($config, background), $background-bottom);
      background-color: map-get($config, background);
    }
  }

  .badge {
    color: map-get($config, background);
    background-color: map-get($config, color);
  }

  .btn-group & {
    border-left-color: transparentize(map-get($config, edge-color), .8);
  }
}

// Button sizes
@mixin button-size($config: (padding, font-size, line-height-ratio, border-radius)) {
  padding:       map-get($config, padding);
  font-size:     map-get($config, font-size);
  line-height:   map-get($config, line-height-ratio);
  border-radius: map-get($config, border-radius);
}

@mixin btn-link-negative-margin($config: (padding)) {
  $padding: map-get($config, padding);
  $left-padding: nth($padding, length($padding));
  margin-left: -1 * $left-padding;
}
