// Contextual module's mixin definitions are here. For the module itself
// check `_contextual.scss`.
// Mixin for alternate mark (contextual color variants).
// Variables:
// - $mark-alt-name : The name of the class used for the alternate mark.
// - $mark-alt-back-color : The background color of the alternate mark.
// - $mark-alt-fore-color : (Optional) The text color of the alternate mark. Defaults to the text color of the mark.
@mixin make-mark-alt-color ($mark-alt-name, $mark-alt-back-color, $mark-alt-fore-color: $mark-fore-color) {
  mark.#{$mark-alt-name} {
    @if $mark-alt-back-color != $mark-back-color {
      background: $mark-alt-back-color;
    }
    @if $mark-alt-fore-color != $mark-fore-color {
      color: $mark-alt-fore-color;
    }
  }
}
// Mixin for alternative mark styles (contextual tags).
// Variables:
// - $mark-alt-name : The name of the class used for the alternate mark style.
// - $mark-alt-border-style : The border-style of the alternate mark style.
// - $mark-alt-border-radius : The border-radius of the alternate mark style.
// - $mark-alt-padding : (Optional) The padding of the alternate mark style. Defaults to the padding of the mark.
// - $mark-alt-font-size : (Optional) The font-size of the alternate mark style. Defaults to the font-size of the mark.
// - $mark-alt-line-height : (Optional) The line height of the alternate mark style. Defaults to the line height of the mark.
// - $mark-alt-box-shadow : (Optional) The box shadow of the alternate mark style. Defaults to the box shadow of the mark.
@mixin make-mark-alt-style ($mark-alt-name, $mark-alt-border-style, $mark-alt-border-radius,
  $mark-alt-padding : $mark-padding, $mark-alt-font-size : $mark-font-size, $mark-alt-line-height : $mark-line-height,
  $mark-alt-box-shadow : $mark-box-shadow ) {
  mark.#{$mark-alt-name} {
    @if $mark-alt-font-size != $mark-font-size {
      font-size: $mark-alt-font-size;
    }
    @if $mark-alt-line-height != $mark-line-height {
      line-height: $mark-alt-line-height;
    }
    @if $mark-alt-border-style != $mark-border-style {
      border: $mark-alt-border-style;
    }
    @if $mark-alt-border-radius != $mark-border-radius {
      border-radius: $mark-alt-border-radius;
    }
    @if $mark-alt-padding != $mark-padding {
      padding: $mark-alt-padding;
    }
    @if $mark-alt-box-shadow != $mark-box-shadow {
      box-shadow: $mark-alt-box-shadow;
    }
  }
}
// Mixin for alternate toast (toast color variants).
// Variables:
// - $toast-alt-name : The name of the class used for the alternate toast.
// - $toast-alt-back-color : The background color of the alternate toast.
// - $toast-alt-fore-color : (Optional) The text color of the alternate mark. Defaults to the text color of the toast.
@mixin make-toast-alt-color ($toast-alt-name, $toast-alt-back-color, $toast-alt-fore-color: $toast-fore-color) {
  @if not ($include-toast) {
    @error "Contextual module's toast mixins are only available if toasts are enabled. Set '$include-toast' to 'true' and try again!";
  }
  .#{$toast-name}.#{$toast-alt-name} {
    @if $toast-alt-back-color != $toast-back-color {
      background: $toast-alt-back-color;
    }
    @if $toast-alt-fore-color != $toast-fore-color {
      color: $toast-alt-fore-color;
    }
  }
}
// Mixin for alternate toast styles (toast style variants).
// Variables:
// - $toast-alt-name : The name of the class used for the alternate toast style.
// - $toast-alt-border-style : The border style of the alternate toast style.
// - $toast-alt-border-radius : Border radius of the alternate toast style.
// - $toast-alt-padding : (Optional) Padding of the alternate toast style. Defaults to the toast's padding.
// - $toast-alt-box-shadow : (Optional) Box shadow of the alretnate toast style. Defaults to the toast's box shadow.
@mixin make-toast-alt-style ($toast-alt-name, $toast-alt-border-style, $toast-alt-border-radius,
  $toast-alt-padding : $toast-padding, $toast-alt-box-shadow : $toast-box-shadow) {
  @if not ($include-toast) {
    @error "Contextual module's toast mixins are only available if toasts are enabled. Set '$include-toast' to 'true' and try again!";
  }
  .#{$toast-name}.#{$toast-alt-name} {
    @if $toast-alt-border-style != $toast-border-style {
      border: $toast-alt-border-style;
    }
    @if $toast-alt-border-radius != $toast-border-radius {
      border-radius: $toast-alt-border-radius;
    }
    @if $toast-alt-padding != $toast-padding {
      padding: $toast-alt-padding;
    }
    @if $toast-alt-box-shadow != $toast-box-shadow {
      box-shadow: $toast-alt-box-shadowbox-shadow;
    }
  }
}
// Mixin for alternate tooltip (tooltip color variants).
// Variables:
// - $tooltip-alt-name : The name of the class used for the alternate tooltip.
// - $tooltip-alt-back-color : The background color of the alternate tooltip.
// - $tooltip-alt-fore-color : (Optional) The text color of the alternate mark. Defaults to the text color of the tooltip.
@mixin make-tooltip-alt-color ($tooltip-alt-name, $tooltip-alt-back-color, $tooltip-alt-fore-color: $tooltip-fore-color) {
  @if not ($include-tooltip) {
    @error "Contextual module's tooltip mixins are only available if tooltips are enabled. Set '$include-tooltip' to 'true' and try again!";
  }
  .#{$tooltip-name}.#{$tooltip-alt-name} {
    @if $tooltip-alt-back-color != $tooltip-back-color {
      &:not(.#{$tooltip-bottom-name}):before { // Top (default) tooltip styling
        border-top-color: $tooltip-alt-back-color;
      }
      &.#{$tooltip-bottom-name}:before { // Bottom tooltip styling
        border-bottom-color: $tooltip-alt-back-color;
      }
    }
    &:after {
      @if $tooltip-alt-back-color != $tooltip-back-color {
        background: $tooltip-alt-back-color;
      }
      @if $tooltip-alt-fore-color != $tooltip-fore-color {
        color: $tooltip-alt-fore-color;
      }
    }
  }
}
// Mixin for alternate tooltip styles (tooltip style variants).
// Variables:
// - $tooltip-alt-name : The name of the class used for the alternate tooltip style.
// - $tooltip-alt-tail-size : The border style of the alternate tooltip style.
// - $tooltip-alt-border-radius : Border radius of the alternate tooltip style.
// - $tooltip-alt-padding : (Optional) Padding of the alternate tooltip style. Defaults to the tooltip's padding.
// - $tooltip-alt-box-shadow : (Optional) Box shadow of the alretnate tooltip style. Defaults to the tooltip's box shadow.
@mixin make-tooltip-alt-style ($tooltip-alt-name, $tooltip-alt-tail-size, $tooltip-alt-border-radius,
  $tooltip-alt-padding : $tooltip-padding, $tooltip-alt-box-shadow : $tooltip-box-shadow) {
  @if not ($include-tooltip) {
    @error "Contextual module's tooltip mixins are only available if tooltips are enabled. Set '$include-tooltip' to 'true' and try again!";
  }
  .#{$tooltip-name}.#{$tooltip-alt-name} {
    @if $tooltip-alt-tail-size != $tooltip-tail-size {
      &:before {
        border-width: $tooltip-alt-tail-size;
        left: calc(50% - #{$tooltip-alt-tail-size});
      }
      &:not(.#{$tooltip-bottom-name}):after { // Top (default) tooltip styling
        margin-bottom: 2 * $tooltip-alt-tail-size;
      }
      &.#{$tooltip-bottom-name}:after { // Bottom tooltip styling
        margin-top: 2 * $tooltip-alt-tail-size;
      }
    }

    &:after {
      @if $tooltip-alt-border-radius != $tooltip-border-radius {
        border-radius: $tooltip-alt-border-radius;
      }
      @if $tooltip-alt-padding != $tooltip-padding {
        padding: $tooltip-alt-padding;
      }
      @if $tooltip-alt-box-shadow != $tooltip-box-shadow {
        box-shadow: $tooltip-alt-box-shadow;
      }
    }
  }
}
// [WARNING: As of v2.2.0, this mixin is deprecated, due to the fact that the alert component is no longer maintained.]
// Mixin for alternate alert (alert color variants).
// Variables:
// - $alert-alt-name : The name of the class used for the alternate alert.
// - $alert-alt-back-color : The background color of the alternate alert.
// - $alert-alt-fore-color : (Optional) The text color of the alternate mark. Defaults to the text color of the alert.
@mixin make-alert-alt-color ($alert-alt-name, $alert-alt-back-color, $alert-alt-fore-color: $alert-fore-color) {
  @if not ($include-alerts) {
    @error "Contextual module's alert mixins are only available if alerts are enabled. Set '$include-alerts' to 'true' and try again!";
  }
  .#{$alert-name}.#{$alert-alt-name} {
    @if $alert-alt-back-color != $alert-back-color {
      background: $alert-alt-back-color;
    }
    @if $alert-alt-fore-color != $alert-fore-color {
      color: $alert-alt-fore-color;
    }
  }
}
// [WARNING: As of v2.2.0, this mixin is deprecated, due to the fact that the alert component is no longer maintained.]
// Mixin for alternate alert styles (alert style variants).
// Variables:
// - $alert-alt-name : The name of the class used for the alternate alert style.
// - $alert-alt-border-style : The border style of the alternate alert style.
// - $alert-alt-border-radius : Border radius of the alternate alert style.
// - $alert-alt-padding : (Optional) Padding of the alternate alert style. Defaults to the alert's padding.
// - $alert-alt-margin : (Optional) Margin of the alternate alert style. Defaults to the alert's margin.
// - $alert-alt-box-shadow : (Optional) Box shadow of the alretnate alert style. Defaults to the alert's box shadow.
@mixin make-alert-alt-style ($alert-alt-name, $alert-alt-border-style, $alert-alt-border-radius,
  $alert-alt-padding : $alert-padding, $alert-alt-margin : $alert-margin,
  $alert-alt-box-shadow : $alert-box-shadow) {
  @if not ($include-alerts) {
    @error "Contextual module's alert mixins are only available if alerts are enabled. Set '$include-alerts' to 'true' and try again!";
  }
  .#{$alert-name}.#{$alert-alt-name} {
    @if $alert-alt-border-style != $alert-border-style {
      border: $alert-alt-border-style;
    }
    @if $alert-alt-border-radius != $alert-border-radius {
      border-radius: $alert-alt-border-radius;
    }
    @if $alert-alt-padding != $alert-padding {
      padding: $alert-alt-padding;
    }
    @if $alert-alt-margin != $alert-margin {
      margin: $alert-alt-margin;
    }
    @if $alert-alt-box-shadow != $alert-box-shadow {
      box-shadow: $alert-alt-box-shadowbox-shadow;
    }
  }
}
