@use 'sass:math';

@use '../functions/_ddivide';
@use './pseudo';

@mixin responsiveRatio($x, $y, $pseudo: false) {
  $padding: (ddivide.ddivide(math.div($y, $x))) * 100 + '%';

  @if $pseudo {
    &:before {
      @include pseudo.pseudo($pos: relative);
      width: 100%;
      padding-top: $padding;
    }
  } @else {
    padding-top: $padding;
  }
}
