$border-size-data: (
  0: 0,
  0.5: 0.5px,
  default: 1px,
  2: 0.125rem,
  4: .25rem,
);

$border-style-data: (
  solid: solid,
  dashed: dashed,
);

@mixin border-style($style: solid, $position: "") {
  $styleValue: map-get($border-style-data, $style);
  @if type-of($styleValue) != string {
    @error "Border style `#{$style}` not found.";
  }
  @if $position ==
    top or
    $position ==
    bottom or
    $position ==
    left or
    $position ==
    right
  {
    border-#{$position}-style: $styleValue;
  } @else {
    border-style: $styleValue;
  }
}

@mixin border-width($size: default, $position: "") {
  $sizeValue: map-get($border-size-data, $size);
  @if type-of($sizeValue) != number {
    @error "Border size `#{$size}` not found.";
  }
  @if $position ==
    top or
    $position ==
    bottom or
    $position ==
    left or
    $position ==
    right
  {
    border-#{$position}-width: $sizeValue;
  } @else {
    border-width: $sizeValue;
  }
}
