@charset 'UTF-8';

////
/// Flavor SCSS Mixins Border
/// @group mixins-border
/// @author blackmirror1980
////

@import 'style';
@import 'radius';

/// Border width mixin
///
/// @link https://www.w3schools.com/cssref/pr_border-width.asp W3Schools border width docs
/// @example scss - Usage
///   .border-width-element {
///     @include border-width(1px);
///   }
///
/// @example css - Output
///   .border-width-element {
///     border-width: 1px;
///   }
/// @access public
/// @param {size} $width [0] - border-width
/// @param {string} $border-selector [border] - border-selector will be used as property name
/// @param {boolean} $important [false] - if true, will render the important rule
@mixin border-width($width: 0, $border-selector: border, $important: false) {
  $border-width: $width;

  @if is-size($border-width) {
    #{$border-selector}-width: $border-width important($important);
  }
  @else {
    @warn '`border-width: #{$border-width}` is not a valid size';
  }
}

/// Border top width mixin
///
/// @example scss - Usage
///   .border-top-width-element {
///     @include border-top-width(1px);
///   }
///
/// @example css - Output
///   .border-top-width-element {
///     border-top-width: 1px;
///   }
/// @see {mixin} border-width
/// @access public
/// @param {size} $width [0] - border-width
/// @param {boolean} $important [false] - if true, will render the important rule
@mixin border-top-width($width: 0, $important: false) {
  @include border-width($width, border-top, $important);
}

/// Border right width mixin
///
/// @example scss - Usage
///   .border-right-width-element {
///     @include border-right-width(1px);
///   }
///
/// @example css - Output
///   .border-right-width-element {
///     border-right-width: 1px;
///   }
/// @see {mixin} border-width
/// @access public
/// @param {size} $width [0] - border-width
/// @param {boolean} $important [false] - if true, will render the important rule
@mixin border-right-width($width: 0, $important: false) {
  @include border-width($width, border-right, $important);
}

/// Border bottom width mixin
///
/// @example scss - Usage
///   .border-bottom-width-element {
///     @include border-bottom-width(1px);
///   }
///
/// @example css - Output
///   .border-bottom-width-element {
///     border-bottom-width: 1px;
///   }
/// @see {mixin} border-width
/// @access public
/// @param {size} $width [0] - border-width
/// @param {boolean} $important [false] - if true, will render the important rule
@mixin border-bottom-width($width: 0, $important: false) {
  @include border-width($width, border-bottom, $important);
}

/// Border left width mixin
///
/// @example scss - Usage
///   .border-left-width-element {
///     @include border-left-width(1px);
///   }
///
/// @example css - Output
///   .border-left-width-element {
///     border-left-width: 1px;
///   }
/// @see {mixin} border-width
/// @access public
/// @param {size} $width [0] - border-width
/// @param {boolean} $important [false] - if true, will render the important rule
@mixin border-left-width($width: 0, $important: false) {
  @include border-width($width, border-left, $important);
}
