Design system 1

Layout and spacing

Build an interface around a shared unit.

A shared unit keeps spacing, rows, and page regions aligned. Design system 1 starts with a 20px base unit and derives larger and smaller values from it.

The spacing scale

TokenValue at the default scaleExample use
--half10pxA small gap
--unit20pxA row or standard gap
--double40pxSection padding
--triple60pxA larger separation

The --ds-grid-unit token multiplies the base unit by the scale factor, --sf.

.project-layout {
  display: grid;
  gap: var(--ds-grid-unit);
  padding: calc(2 * var(--ds-grid-unit));
}

Name the page areas

Give meaningful regions a name with data-ds-area. This makes a layout easier to inspect and discuss.

<aside data-ds-area="Projects">...</aside>
<article data-ds-area="Documentation">...</article>

Inspect this site

Press G three times to toggle the grid. Press L three times to show named layout regions. Press Escape to hide both overlays. Shortcuts are ignored while typing in an input.

These helpers are included locally in this site. Their availability in the published package can differ; see the full grid reference.