/**
 * Positioning
 * https://stackoverflow.design/product/base/position/
 */
@import "helpers";

/* Positions */
$positions: absolute fixed relative static sticky;
@each $prop in $positions {
  .ps-#{$prop} {
    position: #{$prop};
  }
}

/* Coordinates */
@mixin position-coordinates($value,$postfix) {

  @each $name, $prop in $coordinates {
    //@debug $name+'-'+$value+'-'+format-postfix($postfix);
    .#{$name}#{format-postfix($postfix)} {
      #{$prop}: format-value($value);
    }
  }
}

@each $breakpoint, $values in $coordinate_values {
  @include media-screen($breakpoint) {
    @for $i from 1 through length($values) {
      $value: nth($values, $i);
      $postfix: get-previous-breakpoint-value($i, $value, $breakpoint, $coordinate_values);

      @include responsive($breakpoint, $value, $postfix) {
        @include position-coordinates($value, $postfix);
      }
    }
  }
}

/* Coordinates - auto */
@mixin position-coordinates-auto() {
  @each $name, $prop in $coordinates {
    .#{$name}-auto {
      #{$prop}: auto;
    }
  }
}
@include position-coordinates-auto();

// print
$dataset: (
        ab-center:(
                inline:'position:absolute' 'top:50%' 'left:50%' 'transform:translate(-50%, -50%)'
        ),
        ab-center-v:(
                inline:'position:absolute' 'top:50%' 'transform:translateY(-50%)'
        ),
        ab-center-h:(
                inline:'position:absolute' 'left:50%' 'transform:translateX(-50%)'
        ),
        ab-full:(
                selectors: '.ab-full, .ab-full-b:before, .ab-full-a:after, .ab-full-ba:before, .ab-full-ba:after',
                inline: 'position:absolute' 'top:0' 'right:0' 'bottom:0' 'left:0'
        ),
        ab-full-content:(
                selectors: '.ab-full-b:before, .ab-full-a:after, .ab-full-ba:before, .ab-full-ba:after',
                inline: 'content:""'
        ),
        z-hide:(
                inline:'z-index:-1'
        ),
        z-index: (
                prefix:'z',
                hyphen:false,
                value:1 2 3 4 5 10 20 30 40 100 99999999
        ),
);
@include print($dataset);