domestic-ui GitHub

Grid

A responsive grid: as many columns as fit, each at least --grid-min wide, never wider than the container.

Where a grid is used A grid lays out cards or panels in the content area in as many equal columns as fit, here three columns and two rows.

Live example

Grid

<div class="grid" style="--grid-min: 12rem">
  <article data-card>
    <h4>Atoms</h4>
    <p>Native elements styled by the base layer, plus a few attributes.</p>
  </article>
  <article data-card>
    <h4>Molecules</h4>
    <p>Small groups of atoms, such as tabs, dialogs and cards.</p>
  </article>
  <article data-card>
    <h4>Organisms</h4>
    <p>Larger sections built from molecules. Coming later.</p>
  </article>
</div>

API

Attribute or valueEffect
class="grid"
--grid-minminimum column width (default: var(--dui-size-column-min))
--grid-gapgap between cells (default: var(--dui-space-l))

No media queries. Pattern: "RAM" (repeat, auto-fit, minmax), see and "The Grid", Every Layout.

The custom properties do not inherit, so nested grids keep their defaults.

Specifications

See also

How other systems do it

For comparison only; these are not the standard this system follows.

  • Apple Human Interface Guidelines: No equivalent
  • Material Design 3: No equivalent
  • Vercel Geist: No equivalent

Search