Skip to content
Utilities

Spacing

Margin and padding helpers tied to the spacing scale.

Scale

The spacing scale is a quarter-rem ladder:

TokenValue
--b-00
--b-px1px
--b-10.25rem
--b-20.5rem
--b-30.75rem
--b-41rem
--b-51.25rem
--b-61.5rem
--b-82rem
--b-102.5rem
--b-123rem
--b-164rem
--b-205rem
--b-246rem

Margin

m-{0,1,2,3,4,6,8,auto}, mx-{...}, my-{...}, mt-{...}, mb-{...}, ms-{...}, me-{...}.

Padding

p-{0…10}, px-{...}, py-{...}, pt-{...}, pb-{...}.

Gap

gap-{0…12}, gap-x-{2,4}, gap-y-{2,4}.

A
B
C

Logical properties

All spacing utilities use logical properties (margin-block-start, padding-inline) so they work in RTL contexts automatically.

Edit this page