Use the size- utility in Tailwind for cleaner sizing

9/1/2025

#tailwindcss#css#frontend

When you want a square element in Tailwind, you might write both width and height:

<div class="w-16 h-16 bg-blue-500"></div>

But Tailwind has a shorthand: size-.

It sets both width and height at the same time:

<div class="size-16 bg-blue-500"></div>

This keeps your classes shorter and easier to read. Perfect for avatars, icons, or any element that should always be square.

Learn all about the size- utility in the Tailwind CSS documentation.

New: Your Idea. Our Experts. We'll Build Your SaaS For You.

Our 'Done For You' service simplifies the process, taking your concept and delivering a production-ready MVP or complete SaaS solution.

Start your scalable and production-ready SaaS today

Save endless hours of development time and focus on what's important for your customers with our SaaS starter kits for Next.js, Nuxt 3 and SvelteKit

Get started

Stay up to date

Sign up for our newsletter and we will keep you updated on everything going on with supastarter.