@use 'jass_settings';
@use 'border_settings';

$o: null;
@if border_settings.$override == yes {
  $o: !important;
}

.border-, .b- {
  &solid        { border-style: solid $o; }
  &dashed       { border-style: dashed $o; }
  &double       { border-style: double $o; }
  &dotted       { border-style: dotted $o; }
  &none         { border: 0 none $o; }
  &inherit, &ih { border: inherit $o; }
}

@each $unit in border_settings.$border-width-units {
  $v: jass_settings.px($unit);
  .border-width-, .b {
    &#{$unit}  { border-width: $v$o; }
    &t#{$unit} { border-top-width: $v$o; }
    &r#{$unit} { border-right-width: $v$o; }
    &b#{$unit} { border-bottom-width: $v$o; }
    &l#{$unit} { border-left-width: $v$o; }
  }
  .border-width-inherit, .bih  { border-width: inherit $o; }
}
@each $unit in border_settings.$border-radius_units {
  $v: jass_settings.px($unit);
  .border-radius-, .br {
    &#{$unit}   { border-radius: $v$o; }
    &t#{$unit}  { border-top-left-radius: $v$o;
                  border-top-right-radius: $v$o; }
    &r#{$unit}  { border-top-right-radius: $v$o;
                  border-bottom-right-radius: $v$o; }
    &b#{$unit}  { border-bottom-left-radius: $v$o;
                  border-bottom-right-radius: $v$o; }
    &l#{$unit}  { border-top-left-radius: $v$o;
                  border-bottom-left-radius: $v$o; }
    &tr#{$unit} { border-top-right-radius: $v$o; }
    &br#{$unit} { border-bottom-right-radius: $v$o; }
    &bl#{$unit} { border-bottom-left-radius: $v$o; }
    &tl#{$unit} { border-top-left-radius: $v$o; }
  }
}

// @TODO: loop for border colors if enabled in border_settings