4px grid system
BEEQ spacing is built from a 4px grid. Most values are multiples of 4px, which creates predictable alignment and helps layouts scale cleanly across viewports.xs3 through xxl4. Smaller values support tight relationships inside components, while larger values create separation between regions.
Spacing scale
The current BEEQ spacing scale is exposed as CSS custom properties and Tailwind spacing keys. BEEQ defines spacing values inrem so layouts can scale with the root font size.
Pixel values are shown as the default equivalent, based on a 16px root font size.
| Token | CSS variable | Tailwind key | Value |
|---|---|---|---|
xs3 | --bq-spacing-xs3 | xs3 | 0.125rem / 2px |
xs2 | --bq-spacing-xs2 | xs2 | 0.25rem / 4px |
xs | --bq-spacing-xs | xs | 0.5rem / 8px |
s | --bq-spacing-s | s | 0.75rem / 12px |
m | --bq-spacing-m | m | 1rem / 16px |
l | --bq-spacing-l | l | 1.5rem / 24px |
xl | --bq-spacing-xl | xl | 2rem / 32px |
xxl | --bq-spacing-xxl | xxl | 2.5rem / 40px |
xxl2 | --bq-spacing-xxl2 | xxl2 | 3.5rem / 56px |
xxl3 | --bq-spacing-xxl3 | xxl3 | 4rem / 64px |
xxl4 | --bq-spacing-xxl4 | xxl4 | 4.5rem / 72px |
Using spacing in code
BEEQ exposes one spacing scale. Gap utilities do not use separate gap tokens; they use the same values as padding and margin.| Use case | Example |
|---|---|
| CSS custom property | padding: var(--bq-spacing-m); |
| Tailwind padding | p-m, px-l, py-xs |
| Tailwind margin | m-l, mt-xl, mb-xs2 |
| Tailwind gap | gap-m, gap-xl |
| Logical padding | p-b-m, p-bs-xs, p-be-l, p-i-m |
| Logical margin | m-b-l, m-bs-m, m-be-xl, m-i-m |
Internal and external spacing
Internal spacing is the space inside an element or component. It usually uses smaller values because the content is related. External spacing is the space between elements, groups, or page regions. It usually uses larger values to create separation and improve scanability. Component internals already use BEEQ spacing. When you build custom layouts, use the same scale so page-level rhythm matches the components inside it.Usage guidelines
Use the BEEQ scale
Use the BEEQ scale
Choose spacing values from the BEEQ scale instead of arbitrary pixels. This keeps layout rhythm aligned with components and design tokens.
Group related content with smaller spacing
Group related content with smaller spacing
Separate regions with larger spacing
Separate regions with larger spacing
Use larger values such as
l, xl, xxl, and above to separate cards, panels, sections, and page regions.Keep vertical rhythm consistent
Keep vertical rhythm consistent
Use repeated spacing decisions for similar content patterns. Consistent rhythm makes pages easier to scan and reduces visual noise.
Use logical spacing utilities
Use logical spacing utilities
Prefer utilities such as
p-b-m, p-i-m, m-b-l, and m-i-l when spacing should follow block and inline directions instead of physical top, right, bottom, and left.Avoid arbitrary values
Avoid arbitrary values
Avoid values like
10px, 18px, or 30px unless there is a clear exception. Custom values make interfaces harder to align and maintain.Resources
Global CSS variables
Review the spacing custom properties used by BEEQ themes.
Tailwind spacing source
See the source that defines the BEEQ spacing scale.