@import '../variables/sizes.scss';

// Для добавления новых размеров нужно добавить в переменную sizes$ свой размер

$types: (
  "m": "margin",
  "p": "padding"
);


$directions: (
  "t": "top",
  "r": "right",
  "l": "left",
  "b": "bottom",
  "v": "vertical",
  "h": "horizontal",
  "a": "all"
);

@each $classType, $type in $types {
  @each $classDirection, $direction in $directions {
    @each $classSize, $size in $sizes {
      .#{$classType}#{$classDirection}-#{$classSize} {
        @if $direction == 'top' or $direction == 'right' or $direction == 'bottom' or $direction == 'left' {
          #{$type}-#{$direction}: $size!important;
        }

        @if $direction == 'vertical' {
          #{$type}-top: $size!important;
          #{$type}-bottom: $size!important;
        }

        @if $direction == 'horizontal' {
          #{$type}-left: $size!important;
          #{$type}-right: $size!important;
        }

        @if $direction == 'all' {
          #{$type}: $size!important;
        }
      }

      .#{$classType}#{$classDirection}-0 {
        @if $direction == 'top' or $direction == 'right' or $direction == 'bottom' or $direction == 'left' {
          #{$type}-#{$direction}: 0!important;
        }
      }
    }
  }
}
