Rotate

Utilities for rotating elements with transform.

In this article

Class Properties
.rotate-45 transform: rotate(45deg);
.rotate-90 transform: rotate(90deg);
.rotate-180 transform: rotate(180deg);
.rotate-270 transform: rotate(270deg);

Usage

Use .rotate-{degrees} to rotate an element by a certain angle.

<div class="avatar rotate-45">
  <img class="avatar-img" src="..." alt="...">
</div>
<div class="avatar rotate-90">
  <img class="avatar-img" src="..." alt="...">
</div>
<div class="avatar rotate-180">
  <img class="avatar-img" src="..." alt="...">
</div>
<div class="avatar rotate-270">
  <img class="avatar-img" src="..." alt="...">
</div>

Variants

By default, no responsive or hover-state variants are generated for rotate utilities.

Responsive

To include responsive variants like .md:rotate-45, add "rotate" to the $responsive-variants variable in your theme’s _variables.scss file when recompiling your CSS:

$responsive-variants: (
  // ...
  "rotate",
);

Hover-state

To include hover-state variants like .hover:rotate-45, add "rotate" to the $hover-variants variable when recompiling your CSS:

$hover-variants: (
  // ...
  "rotate",
);

Questions or feedback about this article? Let us know