Skip to content
HHydro UIdocs
Navigate
FoundationHydro UI

Spacing

A four-pixel rhythm for calm relationships.

Scale

Use the numbered Layer 2 scale for layout. The scale is based on a 4px rhythm and has eight positive steps plus zero.

TokenValueUse
--hui-space-00Explicit reset or no gap.
--hui-space-14pxTight control/label spacing.
--hui-space-28pxDefault inline or stacked component gap.
--hui-space-312pxComfortable internal spacing.
--hui-space-416pxStandard section or container padding.
--hui-space-520pxLarge component separation.
--hui-space-624pxTouch-oriented or section spacing.
--hui-space-728pxLarge layout rhythm.
--hui-space-832pxPage-level separation.
--hui-space-negative-1-1pxThe screen-reader-only utility offset only.

Rules

  • Use gap for relationships between flex/grid children.
  • Prefer logical properties such as margin-block-start and padding-inline for component layout.
  • Do not introduce a one-off pixel value. Use the closest scale step or add a documented upstream primitive first.
  • --hui-space-100, --hui-space-200, and --hui-space-300 remain compatibility aliases for the original public API; new CSS should use the numbered aliases.