Skip to content
English
No focus16 / 71

Align numbers on the baseline

What it's calledBaseline alignmentGlossary

What goes wrong

A big number and its small unit centred on each other leave the unit floating halfway up, as if it belonged to something else.

The fix

Sit the number, its unit and any label beside it on one shared text baseline.

Tell your AI

Lay out a figure and its unit with display: flex; align-items: baseline (never center), the figure at var(--ds-font-size-2xl) (28px) or larger and the unit at var(--ds-font-size-md) (14px) in var(--ds-text-3), var(--ds-space-4) (4px) apart; put a delta chip beside them on the same baseline.

  • --ds-font-size-2xl28px
  • --ds-font-size-md14px
  • --ds-text-3
  • --ds-space-44px
Why AI-generated UIs all look the same: 12 rules that fix it

Running This week

42.6km12%
Pace5:48/km
Time4h07min

Centred: unit and chip float above the digits