Skip to content

Spacing

Spacing ensures consistent margins, padding, gaps, etc. across various components. The spacing classes are derived from the following root variables.

ValueRoot VariableClass
2px--size-50size-spacing-6xs
4px--size-100size-spacing-5xs
6px--size-150size-spacing-4xs
8px--size-200size-spacing-3xs
12px--size-250size-spacing-2xs
16px--size-300size-spacing-xs
24px--size-400size-spacing-sm
32px--size-500size-spacing-md
40px--size-600size-spacing-lg
48px--size-700size-spacing-xl
64px--size-800size-spacing-2xl
72px--size-900size-spacing-3xl
80px--size-1000size-spacing-4xl
96px--size-1100size-spacing-5xl
128px--size-1200size-spacing-6xl

Usage

Spacing is implemented to extend the default spacing scale of Tailwind. Therefore, these values are inherited by the padding, margin, width, minWidth, maxWidth, height, minHeight, maxHeight, gap, inset, space, translate, scrollMargin, and scrollPadding. (See Tailwind Docs)

To use these spacing, just append the above size-spacing class to Tailwind utilities. The following are some examples:

ClassDescription
spr-m-size-spacing-xsmargin: 16px;
spr-mb-size-spacing-mdmargin-bottom: 32px;
spr-px-size-spacing-4xspadding-left: 6px; padding-right: 6px;