@use "components/operations" as ops;

// Instead of integers, let's name our variations this time ...
$references:("none","half","full","zoom","double","super");

@function scaling($iterator, $name){
  $value: $iterator * .5;
  // ... and retrieve the name by the iterator (don't forget that sass lists start from 1, not 0!!)
  $reference: nth($references, $iterator+1);
  @if($name){
    @return (#{$name}-#{$reference}: $value);
  }
  @return (#{$reference}:$value);
}
@function zoomClasses($val, $key){
  @if(str-index($key,"y-") != null){
    @return scaleY($val);
  }
  @if(str-index($key,"x-") != null){
    @return scaleX($val);
  }
  @return scale($val);
}
@each $scaleType in (null,"y","x"){
  $map: ops.generateMapLoop(5, get-function("scaling"), $scaleType);
  @include ops.mapToClassCallback("scale", $map, "transform", get-function("zoomClasses"));
}



