BEEQ spacing overview
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.BEEQ 4px spacing grid system
xs3 through xxl4. Smaller values support tight relationships inside components, while larger values create separation between regions.
BEEQ spacing tokens
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.
The example below shows a representative subset of the spacing scale. Use the table above as the complete reference for the tokens available in BEEQ.
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 logical utilities for layouts that need to adapt to writing direction or avoid left/right assumptions. Use CSS custom properties when writing custom CSS outside Tailwind utility composition.
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.Spacing inside and between components
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.
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.