Gap
Vertical space measured in the system’s squares.
Design examples
Section titled “Design examples”One square separates a title from its details; two squares mark the next section.
<section class="specimen">
<ds-row class="line" ><ds-text literal strong>Opening hours</ds-text></ds-row><ds-gap size="1"></ds-gap><ds-row class="line" ><ds-text literal >Tuesday to Sunday</ds-text></ds-row><ds-row class="line" ><ds-text literal class="mono">10:00–18:00</ds-text></ds-row><ds-gap size="2"></ds-gap><ds-row class="line" ><ds-text literal tone="muted">Last entry at 17:30</ds-text></ds-row>
</section>
<style>
.specimen { width: 100%; min-width: 0; --cell: calc(20px * var(--sf, 1)); }
.specimen .line { width: 100%; }
.specimen .grow { flex: 1; min-width: 0; }
.specimen .muted { color: var(--ds-text-color-muted); }
.specimen .mono { --ds-typeface-regular: var(--ds-typeface-mono); font-variant-numeric: tabular-nums; }
.specimen .value { width: calc(4 * var(--cell)); text-align: right; }
.specimen .mark { display: inline-flex; align-items: flex-end; width: var(--cell); height: var(--ds-control-height); flex: 0 0 var(--cell); }
.specimen .columns { display: flex; flex-wrap: wrap; gap: var(--cell); }
.specimen .columns > * { min-width: 0; }
.specimen fieldset { border: 0; padding: 0; margin: 0; }
.specimen legend { padding: 0; }
.specimen label { display: flex; align-items: flex-end; gap: calc(var(--cell) / 2); min-height: var(--cell); }
.specimen ds-panel { height: calc(10 * var(--cell)); }
</style> Try it
Section titled “Try it”The gap separates two lines by one 20px square.
<div>First line</div>
<ds-gap unit></ds-gap>
<div>Second line</div> Choose a size
Section titled “Choose a size”Use unit for one square and double for two. The size attribute also selects a scale token, for example size="05" for half a square or size="2" for two squares.
A gap is empty space. It does not wrap content and is not a flexbox gap between children.