@use "../variables";

@mixin margin-auto($number: 0) {
  margin: #{$number * variables.$typography-leading + "px"} auto;
}

@mixin margin-left($number) {
  margin-left: #{$number * variables.$typography-leading + "px"};
}

@mixin margin-right($number) {
  margin-right: #{$number * variables.$typography-leading + "px"};
}

@mixin margin-top($number) {
  margin-top: #{$number * variables.$typography-leading + "px"};
}

@mixin margin-bottom($number) {
  margin-bottom: #{$number * variables.$typography-leading + "px"};
}

@mixin margin-equal($number) {
  margin: #{$number * variables.$typography-leading + "px"};
}

@mixin margin($top, $right, $bottom: null, $left: null) {
  @if not $left and not $bottom {
    margin:
      #{$top * variables.$typography-leading + "px"}
      #{$right * variables.$typography-leading + "px"};
  } @else if not $left or $left == $right {
    margin:
      #{$top * variables.$typography-leading + "px"}
      #{$right * variables.$typography-leading + "px"}
      #{$bottom * variables.$typography-leading + "px"};
  } @else {
    margin:
      #{$top * variables.$typography-leading + "px"}
      #{$right * variables.$typography-leading + "px"}
      #{$bottom * variables.$typography-leading + "px"}
      #{$left * variables.$typography-leading + "px"};
  }
}
