Last updated: 4 May 2024

Tailwind CSS Scale

The scale utility class in Tailwind CSS allows you to apply scaling transformations to elements.


Tailwind Scale

The scale utility class in Tailwind CSS allows you to apply scaling transformations to elements. It provides a convenient way to resize and adjust the size of elements on the web page.

Applying Scale Transformations

To apply a scale transformation to an element, you can use the scale-{value} utility class, where {value} represents the desired scaling factor. The available values range from 0 to 100, allowing you to scale elements up or down.

Here's an example:

html
<div class="scale-50">
<!-- Content here -->
</div>
<div class="scale-100">
<!-- Content here -->
</div>
<div class="scale-125">
<!-- Content here -->
</div>

Preview

Responsive Scale Transformations

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

html
<div class="scale-100 md:scale-90">
<!-- Content here -->
</div>

In the above example, the element is initially scaled to its original size with the scale-100 class, but starting from the medium breakpoint and above, it is scaled to 90% of its original size.

Combining Scale Transformations

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

html
<button class="transform scale-90 hover:scale-100">
<!-- Button content here -->
</button>

In the above example, the button is initially scaled to 90% of its original size, but when hovered over, it returns to its original size.

Tailwind Scale Class Table

ClassProperties
scale-0--tw-scale-x: 0;--tw-scale-y: 0;
scale-50--tw-scale-x: .5;--tw-scale-y: .5;
scale-75--tw-scale-x: .75;--tw-scale-y: .75;
scale-90--tw-scale-x: .9;--tw-scale-y: .9;
scale-95--tw-scale-x: .95;--tw-scale-y: .95;
scale-100--tw-scale-x: 1;--tw-scale-y: 1;
scale-105--tw-scale-x: 1.05;--tw-scale-y: 1.05;
scale-110--tw-scale-x: 1.1;--tw-scale-y: 1.1;
scale-125--tw-scale-x: 1.25;--tw-scale-y: 1.25;
scale-150--tw-scale-x: 1.5;--tw-scale-y: 1.5;
scale-x-0--tw-scale-x: 0;
scale-x-50--tw-scale-x: .5;
scale-x-75--tw-scale-x: .75;
scale-x-90--tw-scale-x: .9;
scale-x-95--tw-scale-x: .95;
scale-x-100--tw-scale-x: 1;
scale-x-105--tw-scale-x: 1.05;
scale-x-110--tw-scale-x: 1.1;
scale-x-125--tw-scale-x: 1.25;
scale-x-150--tw-scale-x: 1.5;
scale-y-0--tw-scale-y: 0;
scale-y-50--tw-scale-y: .5;
scale-y-75--tw-scale-y: .75;
scale-y-90--tw-scale-y: .9;
scale-y-95--tw-scale-y: .95;
scale-y-100--tw-scale-y: 1;
scale-y-105--tw-scale-y: 1.05;
scale-y-110--tw-scale-y: 1.1;
scale-y-125--tw-scale-y: 1.25;
scale-y-150--tw-scale-y: 1.5;

Windframe Tailwind blocks

landing page

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates