@use "../../dev" as *;

@use "../../variables" as *;

// ============================================================================
// StyleScape | Borders | Side
// ============================================================================

// Border Side Mixin
// ----------------------------------------------------------------------------

/// Mixin for setting the border on a specific side.
///
/// @param {String} $side - The side of the element to apply the border (top, bottom, left, right).
/// @param {String} $width - The width of the border. Default is q(1).
/// @param {String} $style - The style of the border (e.g., solid, dotted, dashed). Default is solid.
/// @param {String} $color - The color of the border. Default is black.
@mixin border_side($side, $width: q(1), $style: solid, $color: black) {
    @if $side == top {
        border-top: $width $style $color;
    } @else if $side == bottom {
        border-bottom: $width $style $color;
    } @else if $side == left {
        border-left: $width $style $color;
    } @else if $side == right {
        border-right: $width $style $color;
    }
}

// Border Side Specific Mixins
// ----------------------------------------------------------------------------

/// Mixin for setting a border on the top side of an element.
@mixin border--top {
    @include border_side(top);
}

/// Mixin for setting a border on the bottom side of an element.
@mixin border--bottom {
    @include border_side(bottom);
}

/// Mixin for setting a border on the left side of an element.
@mixin border--left {
    @include border_side(left);
}

/// Mixin for setting a border on the right side of an element.
@mixin border--right {
    @include border_side(right);
}

/// Mixin for setting borders on both the top and bottom sides of an element.
@mixin border--vertical {
    @include border_side(top);
    @include border_side(bottom);
}

/// Mixin for setting borders on both the left and right sides of an element.
@mixin border--horizontal {
    @include border_side(left);
    @include border_side(right);
}

// Full Border Mixin
// ----------------------------------------------------------------------------

/// Mixin for setting borders on all sides of an element.
///
/// @param {String} $width - The width of the border. Default is q(1).
/// @param {String} $style - The style of the border (e.g., solid, dotted, dashed). Default is solid.
/// @param {String} $color - The color of the border. Default is black.
@mixin border_all($width: q(1), $style: solid, $color: black) {
    border: $width $style $color;
}
