@use "core/functions" as *;

/// Mixin to set border-radius
/// @param {String|Number|List} $value - The value of the border-radius, position (top, bottom, start, end) or keyword (full)
/// @param {Number} $radius - The radius of the border (only for position)
/// @example
///   @include border-radius;
///   @include border-radius(full);
///   @include border-radius(top);
///   @include border-radius(start);
///   @include border-radius(top, 10px);
///   @include border-radius(10px 20px 10px 20px);
@mixin border-radius($value: fi-var(global-border-radius), $radius: fi-var(global-border-radius)) {
  @if $value == full {
    border-radius: calc(infinity * 1px);
  } @else if $value == top {
    border-radius: $radius $radius 0 0;
  } @else if $value == bottom {
    border-radius: 0 0 $radius $radius;
  } @else if $value == start {
    border-start-start-radius: $radius;
    border-end-start-radius: $radius;
  } @else if $value == end {
    border-start-end-radius: $radius;
    border-end-end-radius: $radius;
  } @else {
    border-radius: $value;
  }
}
