// Button variants
//
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
//
// Boosted mod: Extra parameter to handle shadow color for inverted buttons

// scss-docs-start btn-variant-mixin
@mixin button-variant(
  $background,
  $border,
  $color: color-contrast($background),
  $hover-background: $black, // Boosted mod
  $hover-border: $black, // Boosted mod
  $hover-color: color-contrast($hover-background),
  $active-background: $primary, // Boosted mod
  $active-border: $primary, // Boosted mod
  $active-color: color-contrast($active-background),
  $disabled-background: $gray-500, // Boosted mod
  $disabled-border: $gray-500, // Boosted mod
  $disabled-color: $white, // Boosted mod
  $btn-focus-shadow-color: $white // Boosted mod
) {
  --#{$prefix}btn-color: #{$color};
  --#{$prefix}btn-bg: #{$background};
  --#{$prefix}btn-border-color: #{$border};
  --#{$prefix}btn-hover-color: #{$hover-color};
  --#{$prefix}btn-hover-bg: #{$hover-background};
  --#{$prefix}btn-hover-border-color: #{$hover-border};
  --#{$prefix}btn-focus-shadow-rgb: #{$btn-focus-shadow-color}; // Boosted mod
  --#{$prefix}btn-active-color: #{$active-color};
  --#{$prefix}btn-active-bg: #{$active-background};
  --#{$prefix}btn-active-border-color: #{$active-border};
  // Boosted mod: no definition of --#{$prefix}btn-active-shadow
  --#{$prefix}btn-disabled-color: #{$disabled-color};
  --#{$prefix}btn-disabled-bg: #{$disabled-background};
  --#{$prefix}btn-disabled-border-color: #{$disabled-border};
}
// scss-docs-end btn-variant-mixin

// Boosted mod: no `@mixin button-outline-variant`

// scss-docs-start btn-size-mixin
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius, $line-height: null, $icon-spacing: $btn-icon-padding-x, $letter-spacing: $letter-spacing-base) {
  --#{$boosted-prefix}icon-spacing: #{$icon-spacing}; // Boosted mod: used for icons
  --#{$prefix}btn-padding-y: #{$padding-y};
  --#{$prefix}btn-padding-x: #{$padding-x};
  @include rfs($font-size, --#{$prefix}btn-font-size);
  --#{$prefix}btn-line-height: #{$line-height}; // Boosted mod
  --#{$prefix}btn-letter-spacing: #{$letter-spacing}; // Boosted mod
  --#{$prefix}btn-border-radius: #{$border-radius};
}
// scss-docs-end btn-size-mixin

// Boosted mod: embed an icon as mask-image in a button
// scss-docs-start btn-icon
@mixin button-icon(
  $icon,
  $width: $spacer,
  $height: $width,
  $size: $width $height,
  $pseudo: "before",
  $selector: &,
  $position: 50%
) {
  min-width: $width;
  min-height: $height;

  @at-root #{$selector} {
    &::#{$pseudo} {
      display: block;
      min-width: inherit;
      min-height: inherit;
      content: "";
      background-color: currentcolor;
      -webkit-mask: #{$icon} no-repeat #{$position} / #{$size}; // stylelint-disable-line property-no-vendor-prefix
      mask: #{$icon} no-repeat #{$position} / #{$size};
    }
  }
}
// scss-docs-end btn-icon
