Skewv1.2.0+
@include('_partials.class-table', [ 'scroll' => true, 'rows' => collect([ ['skew-x', ['--transform-skew-x']], ['skew-y', ['--transform-skew-y']], ])->flatMap(function ($skew) use ($page) { return $page->config['theme']['skew']->map(function ($value, $name) use ($skew) { $class = starts_with($name, '-') ? ".-{$skew[0]}-".substr($name, 1) : ".{$skew[0]}-{$name}"; $code = collect($skew[1])->map(function ($property) use ($value) { return "{$property}: {$value};"; })->implode("\n"); return [$class, $code]; })->values(); }) ])
Usage
Skew an element by first enabling transforms with the transform
utility, then specifying the skew angle using the skew-x-{amount}
and skew-y-{amount}
utilities.
@component('_partials.code-sample', ['class' => 'bg-white lg:flex justify-around items-center text-sm py-12'])
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 skew of an element at a specific breakpoint, add a {screen}:
prefix to any existing skew utility. For example, use md:skew-6
to apply the skew-6
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')
Customizing
Skew scale
By default Tailwind provides seven general purpose skew utilities. You change, add, or remove these by customizing the skew
section of your Tailwind theme config.
@component('_partials.customized-config', ['key' => 'theme.extend.skew'])
- '25': '25deg',
- '60': '60deg', @endcomponent
Learn more about customizing the default theme in the theme customization documentation.
@include('_partials.variants-and-disabling', [ 'utility' => [ 'name' => 'skew', 'property' => 'skew', ], 'variants' => [ 'responsive', 'hover', 'focus', ], ])