1. Layout
  2. box-sizing

Layout

box-sizing

Utility classes for steering how the browser figures out an element's overall size.

ClassStyles
box-border
box-sizing: border-box;
box-content
box-sizing: content-box;

Examples

Baking in borders and padding

Reach for the box-border utility to switch an element's box-sizing to border-box, which tells the browser to fold its borders and padding into whatever height or width you set.

In practice, a 100px × 100px element carrying a 2px border and 4px of padding on every side still paints as 100px × 100px, leaving an inner content area of 88px × 88px:

128px
128px
<div class="box-border size-32 border-4 p-4 ...">  <!-- ... --></div>

Breezel turns this on by default for every element in our baseline reset styles.

Leaving out borders and padding

Reach for the box-content utility to flip an element's box-sizing over to content-box, which asks the browser to layer borders and padding on top of whatever width or height you originally defined.

So a 100px × 100px element carrying a 2px border and 4px of padding on every side ends up painted at 112px × 112px on screen, while its inner content area stays a tidy 100px × 100px:

128px
128px
<div class="box-content size-32 border-4 p-4 ...">  <!-- ... --></div>

Responsive layouts

Add a breakpoint prefix such as md: in front of a box-sizing utility so that it only takes effect from medium screens upward:

<div class="box-content md:box-border ...">  <!-- ... --></div>

Read up on how variants work over in the variants reference docs.

Design UIs that feel great — 5-day mini-course

5-day crash course

Craft UIs people enjoy.

Bite-sized, hands-on video lessons straight from the team behind Breezel, dropped into your inbox every single day for a whole week.

Grab the free course

Copyright © 2026 Breezel, Inc.·Trademark Policy