1. Sizing
  2. block-size

Sizing

block-size

Handy classes to define the block size of any element.

ClassStyles
block-<number>
block-size: calc(var(--spacing) * <number>);
block-<fraction>
block-size: calc(<fraction> * 100%);
block-auto
block-size: auto;
block-px
block-size: 1px;
block-full
block-size: 100%;
block-screen
block-size: 100vh;
block-dvh
block-size: 100dvh;
block-dvw
block-size: 100dvw;
block-lvh
block-size: 100lvh;
block-lvw
block-size: 100lvw;

Examples

Basic example

Reach for block-<number> utilities such as block-24 and block-64 to lock an element to a fixed block size drawn from the spacing scale:

block-96
block-80
block-64
block-48
block-40
block-32
block-24
<div class="block-96 ...">block-96</div><div class="block-80 ...">block-80</div><div class="block-64 ...">block-64</div><div class="block-48 ...">block-48</div><div class="block-40 ...">block-40</div><div class="block-32 ...">block-32</div><div class="block-24 ...">block-24</div>

Using a percentage

Reach for block-full or block-<fraction> utilities such as block-1/2 and block-2/5 to give an element a percentage-based block size:

block-full
block-9/10
block-3/4
block-1/2
block-1/3
<div class="block-full ...">block-full</div><div class="block-9/10 ...">block-9/10</div><div class="block-3/4 ...">block-3/4</div><div class="block-1/2 ...">block-1/2</div><div class="block-1/3 ...">block-1/3</div>

Matching viewport

Reach for the block-screen utility to stretch an element across the full block size of the viewport:

<div class="block-screen">  <!-- ... --></div>

Matching dynamic viewport

Reach for the block-dvh utility to let an element fill the entire block size of the viewport, which adapts as the browser UI expands or contracts:

<div class="block-dvh">  <!-- ... --></div>

Matching large viewport

Reach for the block-lvh utility to give an element's block size the largest possible size of the viewport:

<div class="block-lvh">  <!-- ... --></div>

Fitting the small viewport

Reach for the block-svh utility to give an element's block size the smallest possible size of the viewport:

<div class="block-svh">  <!-- ... --></div>

Setting a custom value

Reach for the block-[<value>] syntax to base the block size on a completely custom value:

<div class="block-[32rem] ...">  <!-- ... --></div>

Working with CSS variables? Reach for the block-(<custom-property>) syntax:

<div class="block-(--my-block-size) ...">  <!-- ... --></div>

Think of this as a tidy shorthand for block-[var(<custom-property>)] that wires up the var() function on your behalf.

Responsive layouts

Add a breakpoint variant such as md: in front of any block-size utility so it only applies at medium screen sizes and up:

<div class="block-1/2 md:block-full ...">  <!-- ... --></div>

Read more about applying variants in the variant reference guide.

Tailoring your theme

Every block-<number> utility is powered by the --spacing theme variable, which you're free to customize in your own theme:

@theme {  --spacing: 1px; }

Read more about tuning your spacing scale over in the theme variable reference guide.

Copyright © 2026 Breezel, Inc.·Trademark Policy