Skip to content

Spacing

Spacing is used to create visual hierarchy and improve readability.
Name
Size
Pixels
00px0px
px1px1px
0.50.125rem2px
10.25rem4px
1.50.375rem6px
20.5rem8px
2.50.625rem10px
30.75rem12px
3.50.875rem14px
41rem16px
51.25rem20px
61.5rem24px
71.75rem28px
82rem32px
92.25rem36px
102.5rem40px
112.75rem44px
123rem48px
143.5rem56px
164rem64px
205rem80px
246rem96px
287rem112px
328rem128px
369rem144px
4010rem160px
4411rem176px
4812rem192px
5213rem208px
5614rem224px
6015rem240px
6416rem256px
7218rem288px
8020rem320px
9624rem384px

Usage in Figma

Spacing tokens are published from Stylus Design Tokens and should be available by default in Scribe Figma files. Select the hexagon icon in applicable fields to apply spacing tokens.

Usage in code

Our spacing scale is inherited from Tailwind and can be used to set padding, margin, width, minWidth, maxWidth, height, minHeight, maxHeight, size, gap, inset, space, translate, scrollMargin, and scrollPadding.

One spacing unit is equal to 0.25rem, which translates to 4px by default in common browsers.

<Component className="p-2" /> // Set padding to 0.5rem (8px)
<Component className="mt-4" /> // Set top margin to 1rem (16px)
<Component className="w-10" /> // Set width to 2.5rem (40px)
<Component className="size-6" /> // Set width and height to 1.5rem (24px)

Prefer using spacing values from the scale whenever possible.