OGXOGX

Spacing & Sizing

Padding, margin, gap, width, and height utilities

Spacing Scale

OGX uses the standard Tailwind spacing scale:

KeyValue
00px
0.52px
14px
1.56px
28px
312px
416px
520px
624px
832px
1040px
1248px
1664px
2080px
2496px
32128px
40160px
48192px
56224px
64256px
72288px
80320px
96384px

Padding

ClassDescription
p-{n}All sides
px-{n}Left and right
py-{n}Top and bottom
pt-{n}Top only
pr-{n}Right only
pb-{n}Bottom only
pl-{n}Left only
'p-8'      // 32px all sides
'px-16'    // 64px left and right
'py-4'     // 16px top and bottom
'pt-8 pb-4' // 32px top, 16px bottom

Margin

ClassDescription
m-{n}All sides
m-autoAuto margin
mx-{n}Horizontal margin
mx-autoCenter horizontally
my-{n}Vertical margin
my-autoCenter vertically
mt-{n}Top margin
mr-{n}Right margin
mb-{n}Bottom margin
ml-{n}Left margin
'm-4'       // 16px all sides
'mx-auto'   // Center horizontally
'mt-8 mb-4' // Different top/bottom

Gap

ClassDescription
gap-{n}Gap in all directions
gap-x-{n}Column gap only
gap-y-{n}Row gap only
'gap-4'    // 16px gap between children
'gap-x-8'  // 32px horizontal gap
'gap-y-2'  // 8px vertical gap

Width

ClassDescription
w-{n}Fixed width (spacing scale)
w-fullwidth: 100%
w-screenwidth: 100vw
w-autowidth: auto
w-fitWidth fits content
w-1/2, w-1/3, etc.Fractional widths

Min/Max Width

ClassDescription
min-w-fullmin-width: 100%
max-w-fullmax-width: 100%
max-w-{n}Fixed max-width

Height

ClassDescription
h-{n}Fixed height (spacing scale)
h-fullheight: 100%
h-screenheight: 100vh
h-autoheight: auto
h-fitHeight fits content

Min/Max Height

ClassDescription
min-h-fullmin-height: 100%
max-h-fullmax-height: 100%

Arbitrary Values

Use brackets for custom values:

'p-[32px]'      // 32px padding
'w-[300px]'     // 300px width
'gap-[1.5rem]'  // 1.5rem gap
'm-[10%]'       // 10% margin

On this page