Actual CSS

Spacing Helpers

Semantic step helpers for gap, padding, and margin — the most common inline-style escape hatches.

Class reference

Base utilities:

ClassDescription
.gap-nonegap: 0 on the element itself.
.pyBlock (vertical) padding at the current density step.
.pxInline (horizontal) padding at the current density step.
.mbsBlock-start margin at the current density step.
.mbeBlock-end margin at the current density step.

Extra utilities:

ClassDescription
.padding-contextAll-side padding at the current density step.
.gap-contextgap: var(--gap).
.row-gap-contextrow-gap: var(--gap).
.column-gap-contextcolumn-gap: var(--gap).
.margin-inline-autoHorizontally centers a block.
.margin-inline-start-autoPushes a block toward the inline end.
.margin-inline-end-autoPushes a block toward the inline start.
.margin-block-start-autoPushes content toward the block end.
.margin-block-end-autoPushes content toward the block start.

Spacing helpers follow the density context. The default step is --space-40 (1rem); the .compact context tightens it to --space-20 (0.5rem) and the .spacious context loosens it to --space-50 (1.5rem). All helpers read --density-space and map to logical properties (padding-block, margin-block-end, etc.) for writing-direction safety.

Gap

Override the default gap from layout primitives (.stack, .cluster, .grid):

<ul class="cluster">
  <li><a href="/about" class="btn ghost">About</a></li>
  <li><a href="/contact" class="btn ghost">Contact</a></li>
</ul>
  • .gap-nonegap: 0

.gap-none sets the element's own gap directly and does not change --gap for nested layouts. For a denser or roomier rhythm, use the .compact / .spacious density contexts, or set the gap property on the instance when the change must stop there.

--gap defines the contextual rhythm; .gap-context applies that rhythm to a container that does not already consume --gap. The layout primitives (.stack, .cluster, .grid, …) read it on their own.

Padding

Block (vertical) and inline (horizontal) padding. Values respond to the density context.

Panel content with breathing room above and below.
<section role="tabpanel" class="py">
  Panel content with breathing room above and below.
</section>
  • .pypadding-block: var(--density-space)
  • .pxpadding-inline: var(--density-space)

Margin

Block-start and block-end margin for giving elements room:

A section heading with space above

<h2 class="mbs">A section heading with space above</h2>
  • .mbsmargin-block-start: var(--density-space)
  • .mbemargin-block-end: var(--density-space)

No mbs-none / mbe-none — use margin: 0 via .list-reset for lists, or a layout primitive that already resets margins (.stack > *).

CSS hooks

  • --density-space — the step every padding and margin helper reads; .compact sets it to --space-20, default to --space-40, .spacious to --space-50.
  • --gap — base gap of layout primitives; read by the optional .gap-context, .row-gap-context, and .column-gap-context helpers.
Actual CSS

Search documentation