Layout ds-stack
Stack, cluster, sidebar
Three flow primitives that own spacing and wrapping so children do not have to. Each is configured entirely through custom properties.
ds-stack โ vertical rhythm
First
Second
Third
ds-cluster โ wrapping row
ds-sidebar โ two columns that wrap when narrow
Sidebar
Main content, which keeps at least half the width until the pair
no longer fits and the sidebar wraps above it.
Custom properties
Usage example
<ds-stack style="--ds-stack-gap: 16px">
<div>First</div>
<div>Second</div>
</ds-stack>
<ds-cluster style="--ds-cluster-gap: 12px">
<span>Tag</span>
<span>Another tag</span>
</ds-cluster>
<ds-sidebar
style="--ds-sidebar-gap: 16px; --ds-sidebar-target: 12rem"
>
<nav>Sidebar</nav>
<main>Main content</main>
</ds-sidebar>
API Reference
| Element | Custom property | Default | Description |
|---|---|---|---|
| ds-stack | --ds-stack-gap | --ds-spacing-md | Vertical gap between stacked children. |
| ds-cluster | --ds-cluster-gap | --ds-spacing-md | Gap between children in a wrapping, centred row. |
| ds-sidebar | --ds-sidebar-gap | --ds-spacing-md | Gap between the sidebar and the main column. |
| ds-sidebar | --ds-sidebar-target | 20rem | Preferred sidebar width. The first child takes it; the second keeps at least half the width and wraps below that. |