// stylelint-disable
@use 'sass:map';
@use '../../config' as CONFIG;

$_positions: (
  'top',
  'bottom',
  'right',
  'left',
);

$_utilTypes: (
  'padding',
  'margin',
  'spacer',
);

@mixin keywordSizes {
  @each $utilType in $_utilTypes {
    @each $keyword, $size in CONFIG.$SIZING_INTERNAL {
      @if ($utilType == 'spacer') {
        .u-spacer-#{$keyword} {
          &#{&} {
            clear: both;
            height: #{$size}px;
          }
        }
        .u-margin-all-#{$keyword} {
          &#{&} {
            margin: #{$size}px;
          }
        }
        .u-padding-all-#{$keyword} {
          &#{&} {
            padding: #{$size}px;
          }
        }
      } @else {
        @each $position in $_positions {
          .u-#{$utilType}-#{$position}-#{$keyword} {
            &#{&} {
              #{$utilType}-#{$position}: #{$size}px;
            }
          }
          @if ($position == 'top') {
            .u-#{$utilType}-block-#{$keyword} {
              &#{&} {
                #{$utilType}-block: #{$size}px;
                #{$utilType}-top: #{$size}px;
                #{$utilType}-bottom: #{$size}px;
              }
            }
          } @else if ($position == 'left') {
            .u-#{$utilType}-inline-#{$keyword} {
              &#{&} {
                #{$utilType}-inline: #{$size}px;
                #{$utilType}-left: #{$size}px;
                #{$utilType}-right: #{$size}px;
              }
            }
          }
        }
      }
    }
  }
}

