Rotatev1.2.0+

Utilities for rotating elements with transform.

@include('_partials.class-table', [ 'scroll' => true, 'rows' => $page->config['theme']['rotate']->map(function ($value, $name) { $class = starts_with($name, '-') ? ".-rotate-".substr($name, 1) : ".rotate-{$name}"; $code = "--transform-rotate: {$value};"; return [$class, $code]; }) ])

Usage

Rotate an element by first enabling transforms with the transform utility, then specifying the rotation angle using the rotate-{angle} utilities.

@component('_partials.code-sample', ['class' => 'bg-white lg:flex justify-around items-center text-sm py-12'])

@slot('code')@endslot @endcomponent

Note that because Tailwind implements transforms using CSS custom properties, the transform utilities are not supported in older browsers like IE11. If you need transforms for your project and need to support older browsers, add your own utilities or other custom CSS.

Responsive

To control the rotation of an element at a specific breakpoint, add a {screen}: prefix to any existing rotate utility. For example, use md:rotate-90 to apply the rotate-90 utility at only medium screen sizes and above.

For more information about Tailwind's responsive design features, check out the Responsive Design documentation.

@component('_partials.responsive-code-sample', ['class' => 'bg-white flex justify-center items-center py-12']) @slot('none')

@endslot @slot('sm')@endslot @slot('md')@endslot @slot('lg')@endslot @slot('xl')@endslot @slot('code')@endslot @endcomponent

Customizing

Rotate scale

By default Tailwind provides seven general purpose rotate utilities. You change, add, or remove these by editing the theme.rotate section of your Tailwind config.

@component('_partials.customized-config', ['key' => 'theme.rotate'])

  • '-180': '-180deg', '-90': '-90deg',
  • '-45': '-45deg', '0': '0', '45': '45deg', '90': '90deg',
  • '135': '135deg', '180': '180deg',
  • '270': '270deg', @endcomponent

Learn more about customizing the default theme in the theme customization documentation.

@include('_partials.variants-and-disabling', [ 'utility' => [ 'name' => 'rotate', 'property' => 'rotate', ], 'variants' => [ 'responsive', 'hover', 'focus', ], ])

Tailwind UI is now in early access!