$hu-rotate-core-modules: hu-format-modules(hu-get-class-modules($hu-rotate-modules, core, $hu-rotate-modules));
$hu-rotate-pseudos: hu-get-class-modules($hu-rotate-modules, pseudos, null);
$hu-rotate-parents: hu-get-class-modules($hu-rotate-modules, parents, null);
$hu-rotate-property-name: transform;
$hu-rotate-class-name: hu-get-class-name(($hu-rotate-alias: $hu-rotate-property-name));

@each $module in $hu-rotate-core-modules {
  @each $type, $value in $hu-rotate-types {
    $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
    $value: if($value, $value, $type);

    @include hu-generic($class-name, $module) {
      #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
    }
  }
}

@if (index($hu-rotate-core-modules, responsive)) {
  @each $mq-scale, $mq-value in $hu-media-queries {
    @include hu-media-query($mq-value) {
      @each $type, $value in $hu-rotate-types {
        $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
        $value: if($value, $value, $type);

        @include hu-responsive($class-name, $hu-rotate-core-modules, $mq-scale) {
          #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
        }
      }
    }
  }
}

@if ($hu-rotate-pseudos) {
  @each $module in $hu-rotate-core-modules {
    @each $type, $value in $hu-rotate-types {
      $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
      $value: if($value, $value, $type);

      @include hu-pseudo($class-name, $hu-rotate-pseudos, $module) {
        #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
      }
    }
  }

  @if (index($hu-rotate-core-modules, responsive)) {
    @each $mq-scale, $mq-value in $hu-media-queries {
      @include hu-media-query($mq-value) {
        @each $type, $value in $hu-rotate-types {
          $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
          $value: if($value, $value, $type);

          @include hu-pseudo-responsive($class-name, $hu-rotate-pseudos, $hu-rotate-core-modules, $mq-scale) {
            #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
          }
        }
      }
    }
  }
}

@if ($hu-rotate-parents) {
  @each $module in $hu-rotate-core-modules {
    @each $type, $value in $hu-rotate-types {
      $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
      $value: if($value, $value, $type);

      @include hu-parent($class-name, $hu-rotate-parents, $module) {
        #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
      }
    }
  }

  @if (index($hu-rotate-core-modules, responsive)) {
    @each $mq-scale, $mq-value in $hu-media-queries {
      @include hu-media-query($mq-value) {
        @each $type, $value in $hu-rotate-types {
          $class-name: hu-class-name("#{$hu-rotate-class-name}:#{$type}");
          $value: if($value, $value, $type);

          @include hu-parent-responsive($class-name, $hu-rotate-parents, $hu-rotate-core-modules, $mq-scale) {
            #{$hu-rotate-property-name}: rotate($value) #{hu-important()};
          }
        }
      }
    }
  }
}
