A unified system for dimensions, spacing, and scale.
Dialtone uses a unified set of layout and spacing design tokens for all dimensional values. These tokens define both the intrinsic dimensions of UI surfaces (e.g. width, height) and the spatial relationships between them (e.g. padding, gap, positioning).
Layout and spacing tokens are CSS custom properties (a.k.a. CSS variables) generated from two base units:
8px64px| Token | Math | Value |
|---|---|---|
--dt-spacing-100 | 1 × 8px | 8px |
--dt-spacing-400 | 4 × 8px | 32px |
--dt-layout-100 | 1 × 64px | 64px |
--dt-layout-400 | 4 × 64px | 256px |
Because the formula is deterministic, tools and code-generation assistants (including LLMs) can resolve any stop without needing the full reference table in context.
For the complete set, view Spacing Tokens and Layout Tokens. For the story behind why layout and spacing live in separate families, see New Layout and Spacing Token Systems.
You rarely need these tokens directly. The primitive triad exposes them through three components:
Compose the triad; reach for raw design tokens or CSS utilities as an escape hatch.
The primitive triad handles layout and spacing declaratively. For example:
padding: space inside a container, uses --dt-spacing-* design tokensmin-inline-size: container width, uses --dt-layout-* design tokensinset-block-start: positioned container offset, uses documented coordinate values such as --dt-spacing-*, negative spacing tokens, and side-specific percentage coordinatesgap: space between boxes, uses --dt-spacing-* design tokens<dt-stack direction="row" gap="200"> <dt-box min-inline-size="300" padding="200" surface="moderate" border-width="100" border-radius="300"> <dt-text as="p" kind="body" size="200" tone="tertiary" align="center">Box 1</dt-text> </dt-box> <dt-box min-inline-size="300" padding="200" surface="moderate" border-width="100" border-radius="300"> <dt-text as="p" kind="body" size="200" tone="tertiary" align="center">Box 2</dt-text> </dt-box> <dt-box min-inline-size="300" padding="200" surface="moderate" border-width="100" border-radius="300"> <dt-text as="p" kind="body" size="200" tone="tertiary" align="center">Box 3</dt-text> </dt-box> </dt-stack>
min-inline-size, or min-block-size so containers adapt to their context.inline-size, min-inline-size, max-inline-size, plus their block-axis equivalents) over raw width and height.width or height) when a layout can flex.margin for layout. It lives outside the element, collapses in surprising ways, and may not scale well since it assumes a sibling element's presence. You might likely can achieve the same result with DtStack's gap or careful use of padding.gap to space siblings apart, vertically or horizontally.--dt-spacing-* values for gaps inside a container (between headings, text, buttons) and larger values for gaps between regions of a page.d-d-flex + d-ai-* + d-jc-* + d-g-*) for layouts DtStack already expresses as props.Typography is the third leg of the triad.
d-fs-*, d-lh-*, d-fw-*) when DtText already exposes the right props.The triad covers most size and space needs. These utility classes remain available for cases the components don't cover.
| Purpose | Utility | Prefer |
|---|---|---|
| Padding | d-p-* | DtBox padding / padding-inline / padding-block |
| Margin | d-m-* | DtStack gap for between-element spacing |
| Flex / grid gap | d-g-* | DtStack gap |
| Width / height | d-w* / d-h* | DtBox inline-size / block-size |
| Min / max width | d-wmn-* / d-wmx-* | DtBox min-inline-size / max-inline-size |
| Position | d-ps-* | DtBox position |
| Coordinates | d-ibs-* / d-iie-* | DtBox inset-block-start / inset-inline-end |
| Z-index | d-zi-* | DtBox z-index |
| Enable flex container | d-d-flex | DtStack |
| Cross-axis alignment | d-ai-* | DtStack align |
| Main-axis distribution | d-jc-* | DtStack justify |
For the full set, view Spacing Tokens, Layout Tokens, and CSS Utilities.
--dt-layout-* and --dt-spacing-* keep sizing and spacing consistent without manual pixel math.padding inside containers and gap between them. Avoid margin for layout wherever possible.min-* constraints respond better across screen sizes.Layout and Spacing documentation last updated Friday, September 4, 2026
fix/popover-modal-zindex-scope