@import "settings";

/// Flag whether or not you want to include bonsai separator components
/// @type bool
$bonsai-include-rule-styles: $bonsai-include-components !default;

/// Styling for horizontal separators
/// @param {number} $width - How wide should the separator be?
/// @param {number} $margin [20px] - Define the margin around the separator
/// @param {string} $side ['bottom'] - What side should the separator be? For horizontal, should to `top` or `bottom`
/// @param {number} $border-width [1px] - How wide should the border be?
/// @param {string} $border-style [solid] - What style of border should the separator be?
/// @param {color} $border-color [$bonsai-medium-gray] - What color should the separator be?
@mixin horizontal-rule-helper (
  $width,
  $margin: 20px,
  $side: 'bottom',
  $border-width: 1px,
  $border-style: solid,
  $border-color: $bonsai-very-light-gray
) {
  border-#{$side}: $border-color $border-width $border-style;
  width: $width;
  margin: $margin 0 $margin 0;
}

/// Styling for vertical separators
/// @param {number} $height - How tall should the separator be?
/// @param {number} $margin [20px] - Define the margin around the separator
/// @param {string} $side ['left'] - What side should the separator be? For vertical, should to `left` or `right`
/// @param {number} $border-width [1px] - How wide should the border be?
/// @param {string} $border-style [solid] - What style of border should the separator be?
/// @param {color} $border-color [$bonsai-medium-gray] - What color should the separator be?
@mixin vertical-rule-helper (
  $height,
  $margin: 20px,
  $side: 'left',
  $border-width: 1px,
  $border-style: solid,
  $border-color: $bonsai-light-gray
) {
  border-#{$side}: $border-color $border-width $border-style;
  height: $height;
  margin: 0 $margin 0 $margin;
}

/// Gateway mixin for bonsai separators
@mixin rule-styles {
  @if $bonsai-include-rule-styles {
    .horizontal-rule-full-width {
      @include horizontal-rule-helper(100%);
    }

    .vertical-rule-full-height {
      @include vertical-rule-helper(100%);
    }
  }
}
