Tailwind CSS Skew

The skew utility class in Tailwind CSS allows you to apply skew transformations to elements. Skewing is a transformation that tilts or slants an element along either the horizontal or vertical axis, giving it a unique visual effect.

Applying Skew Transformations

To apply a skew transformation to an element, you can use the skew-{value} utility class, where {value} represents the desired angle of skewing. The available values range from -180 to 180, allowing you to skew elements in both positive and negative directions.

Here's an example:

html
<div class="skew-y-0">
<!-- Content here -->
</div>
<div class="skew-x-12">
<!-- Content here -->
</div>
<div class="skew-y-12">
<!-- Content here -->
</div>

Preview

Responsive Skew Transformations

Tailwind CSS allows you to apply skew transformations responsively at different breakpoints. To use responsive skew classes, you can append the breakpoint prefix to the utility class. For example, md:skew-x-4 applies a skew transformation to the element along the horizontal axis starting from the medium breakpoint and above.

html
<div class="skew-x-4 md:skew-x-0">
<!-- Content here -->
</div>

In the above example, the element is initially skewed by 4 degrees along the horizontal axis with the skew-x-4 class, but starting from the medium breakpoint and above, it returns to its original skew angle using the skew-x-0 class.

Combining Skew Transformations

You can combine skew transformations with other utility classes in Tailwind CSS to achieve more complex visual effects. For example, you can combine the skew class with the hover class to apply a skew transformation on hover:

html
<button class="transform skew-y-6 hover:skew-y-0">
<!-- Button content here -->
</button>

In the above example, the button is initially skewed by 6 degrees along the vertical axis, but when hovered over, it returns to its original skew angle.

Tailwind Skew Class Table

ClassProperties
skew-x-0--tw-skew-x: 0deg;
skew-x-1--tw-skew-x: 1deg;
skew-x-2--tw-skew-x: 2deg;
skew-x-3--tw-skew-x: 3deg;
skew-x-6--tw-skew-x: 6deg;
skew-x-12--tw-skew-x: 12deg;
-skew-x-12--tw-skew-x: -12deg;
-skew-x-6--tw-skew-x: -6deg;
-skew-x-3--tw-skew-x: -3deg;
-skew-x-2--tw-skew-x: -2deg;
-skew-x-1--tw-skew-x: -1deg;
skew-y-0--tw-skew-y: 0deg;
skew-y-1--tw-skew-y: 1deg;
skew-y-2--tw-skew-y: 2deg;
skew-y-3--tw-skew-y: 3deg;
skew-y-6--tw-skew-y: 6deg;
skew-y-12--tw-skew-y: 12deg;
-skew-y-12--tw-skew-y: -12deg;
-skew-y-6--tw-skew-y: -6deg;
-skew-y-3--tw-skew-y: -3deg;
-skew-y-2--tw-skew-y: -2deg;
-skew-y-1--tw-skew-y: -1deg;

Windframe Tailwind blocks

landing page

Build modern projects using Bootstrap 5 and Contrast

Trying to create components and pages for a web app or website from scratch while maintaining a modern User interface can be very tedious. This is why we created Contrast, to help drastically reduce the amount of time we spend doing that. so we can focus on building some other aspects of the project.

Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants. Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.

ad-banner