Skip to Content

Spacing

Clover uses spacing determined by the golden ratio , from your page’s 1rem. The more closely two things belong together, the smaller the space between them.

The scale

Each space is φ, about 1.618, times the one below it, and m is your page’s 1rem. The same scale sets margins, paddings, gaps and text sizes. Every space is a custom property: set one on :root, and everything that uses it follows.

Change your 1rem in the table. Every space follows, and so does the Viewer above it.

VariableSizeAt 16pxWhat it sizes
Your page
HTML page1rempxYour page’s root font-size
Spaces
--clover-space-3xs0.146rem2.3pxφ⁻⁴
--clover-space-2xs0.236rem3.8pxφ⁻³
--clover-space-xs0.382rem6.1pxφ⁻²: a thumbnail over its label
--clover-space-s0.618rem9.9pxφ⁻¹: within a component
--clover-space-m1rem16pxYour 1rem: between components in a region
--clover-space-l1.618rem25.9pxφ: a region’s inset
--clover-space-xl2.618rem41.9pxφ²
--clover-space-2xl4.236rem67.8pxφ³
Controls and components
--clover-control2.236rem35.8pxEvery round control, wide and high
--clover-inset1.618rem25.9pxA region’s inset, from its edge to its components
--clover-radius-pill2rem32pxFully rounded corners, as on the round controls and Search’s field
--clover-items-height8rem128pxThe pictures in Items’ slider
--clover-items-size10rem160pxA cell of Items’ grid
--clover-map-height24rem384pxThe Map

Which space goes where

A region, such as a template’s header, its thumbnail strip or the Panel, keeps --clover-inset (l) between its edge and the components in it. Inside, the closer things belong, the smaller the space: m between components (s along Default’s header and Document’s toolbar, l under the Gallery’s header), s within a component, and xs between a thumbnail and its label.

Set --clover-inset to make a layout tighter or roomier:

.my-layout { --clover-inset: var(--clover-space-m); }

The Body

The Body is --clover-body-height tall: 60vh, or its template’s own. Set yours around a Body you compose, or on .clover-template-default:

.my-layout { --clover-body-height: 70vh; }

In Document, the Body fills its page: size Document with --clover-template-document-height.

At home, the picture fills the Body edge to edge, except in Document, which keeps --clover-inset around it. The Body’s controls sit --clover-inset in from its edges, in line with the components around the Body. To change either, set --clover-canvas-inset or --clover-canvas-controls-inset on .clover-canvas itself.

On a screen under 31rem wide, such as a phone’s, the controls sit m in, and so do the Panel, Default’s header and thumbnail strip, and Document’s toolbar.