// ============================================================================
// StyleScape | Borders | Width
// ============================================================================

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

// Border Width mixin
// ----------------------------------------------------------------------------

// Mixin for Generic Border Width
// @mixin border_width($width) {
//     border-width: $width !important;
// }
/// Mixin for setting border width based on a multiplier.
///
/// @param {Number} $multiplier - Multiplier to calculate border width.
@mixin border_width_multiplier($multiplier) {
    border-width: q(1) * $multiplier;
}

/// Mixin for setting individual border side widths.
///
/// @param {Number | null} $top - Top border width.
/// @param {Number | null} $right - Right border width.
/// @param {Number | null} $bottom - Bottom border width.
/// @param {Number | null} $left - Left border width.
@mixin border_width_side(
    $top: null,
    $right: null,
    $bottom: null,
    $left: null
) {
    @if $top != null {
        border-top-width: $top !important;
    }
    @if $right != null {
        border-right-width: $right !important;
    }
    @if $bottom != null {
        border-bottom-width: $bottom !important;
    }
    @if $left != null {
        border-left-width: $left !important;
    }
}

// Border Widths
// ============================================================================

/// Specific border width mixins based on multiplier.
@mixin border_width_01 {
    @include border_width_multiplier(1);
}

@mixin border_width_02 {
    @include border_width_multiplier(2);
}

@mixin border_width_03 {
    @include border_width_multiplier(3);
}

@mixin border_width_04 {
    @include border_width_multiplier(4);
}

@mixin border_width_05 {
    @include border_width_multiplier(5);
}

@mixin border_width_06 {
    @include border_width_multiplier(6);
}

@mixin border_width_07 {
    @include border_width_multiplier(7);
}

@mixin border_width_08 {
    @include border_width_multiplier(8);
}

@mixin border_width_09 {
    @include border_width_multiplier(9);
}

@mixin border_width_10 {
    @include border_width_multiplier(10);
}

/// Mixin for thin border.
@mixin border_thin {
    @include border_width_01;
}

/// Mixin for medium border.
@mixin border_medium {
    @include border_width_02;
}

/// Mixin for thick border.
@mixin border_thick {
    @include border_width_03;
}

// No Border
// ============================================================================

/// Mixin to remove the top border.
@mixin no_border--top {
    @include border_width_side($top: 0);
}

/// Mixin to remove the bottom border.
@mixin no_border--bottom {
    @include border_width_side($bottom: 0);
}

/// Mixin to remove the right border.
@mixin no_border--right {
    @include border_width_side($right: 0);
}

/// Mixin to remove the left border.
@mixin no_border--left {
    @include border_width_side($left: 0);
}
