Book a callGitHub224

Craft03/05

Interface details that add up

Updated · Suggest a change

Most of these details go unnoticed one at a time. Together they decide whether an interface feels careful. (STD-visual-details-50)

Each rule is an OpenDesigner house standard or one of its accessibility floors, with its source. The drawings use this site's own type and colors, and their measurements are real.

Letter spacing and line height change with size

Never use one letter spacing for every size, and set line height inversely to size. (STD-visual-details-05, STD-visual-details-06) Capitals need more room, or they look cramped. (STD-visual-details-04)

TextLetter spacingLine height
Large headingstightened, for example -0.02emtight, for example 1.05
Body textnear 0looser, for example 1.5
Small textslightly more
Small capital labels+0.06em in OpenDesigner's tokens; capitals are never tightened

Build hierarchy from weight, size and line height together, not size alone. (STD-visual-details-07)

Keep lines of body text to about 65 characters. (STD-visual-details-01)

1
Quarterly review
2
Status · In progress
3
Revenue grew in every region this quarter. The largest gain came from renewals, which rose for the third quarter in a row.
  1. 1
    Large text: tighter. Letter spacing -0.02em, line height 1.05. Big letters drift apart, so they are pulled in.
  2. 2
    Capitals: looser. Wider than the same words in sentence case. This label uses 0.07em.
  3. 3
    Body: neutral. Letter spacing near 0, line height 1.5, lines no wider than about 65 characters.
One set of letter spacing does not fit every size. Large headings are tightened and set close, small capital labels are opened up, and body text stays near zero with looser lines and a width limit of about 65 characters.

Source: the apple-design skill in emilkowalski/skills, and Emil Kowalski's essay Agents with taste for capitals and line length.

Numbers that change in place

Use tabular digits, font-variant-numeric: tabular-nums, for price columns and numbers that update, like timers and counters. Every digit has the same width, so columns line up and a changing number doesn't shift. (STD-visual-details-02) When a number animates, use the NumberFlow library instead of re-rendering the text. (STD-visual-details-59)

Digits of different widths

The narrow 1s pull some amounts to the right, so the decimal points no longer line up and the column is hard to scan.

proportional digits
Hosting$1,204.50
Design tools$611.11
Contractors$8,410.00
Travel$1,111.19

Tabular digits

Every digit takes the same width, so the decimal points sit on one line and a changing number does not jiggle.

font-variant-numeric: tabular-nums
Hosting$1,204.50
Design tools$611.11
Contractors$8,410.00
Travel$1,111.19
The same expense column twice, with a dashed line where the decimal points should sit. The left column is drawn with narrow 1s, the way many typefaces set digits by default, and the amounts drift. With tabular digits they line up, and counters and timers stop shifting as they change.

Source: Emil Kowalski's Agents with taste and the animation-vocabulary and pick-ui-library skills in emilkowalski/skills.

Small habits in text

Write the ellipsis as one character (…), never three periods. (STD-visual-details-03) Underline only links, so an underline always means "you can click this". (STD-visual-details-09) Emphasize interface text with weight, not italics. (STD-visual-details-08)

Print habits in an interface

Three periods instead of an ellipsis, an underline on words that are not a link, and italics for emphasis.

Saving...three periods
Sign-in needs a second stepunderline, not a link
Recommended for adminsitalic emphasis

Interface habits

One ellipsis character, weight for emphasis, and underlines kept for links, so an underline always means “you can click this”.

Saving…one character: …
Sign-in needs a second stepweight for emphasis
Learn about passkeysunderline = link
Three small text habits. Use the single ellipsis character instead of three periods, emphasize interface text with weight instead of italics or underlines, and underline only links, so an underline stays a promise that the words can be clicked.

Source: Emil Kowalski's Agents with taste.

Soft edges, not hard lines

Separate surfaces with a semi-transparent shadow rather than a solid, opaque border. (STD-visual-details-14)

A solid, opaque border

A flat, opaque gray line draws the same hard box around each card, whatever sits behind it.

Starter plan3 projects · 2 seats
Team planUnlimited projects · 10 seats
border: 1px solid #808793

A semi-transparent shadow

A faint ring of the ink color plus a soft drop. The edge is partly see-through, so it blends with whatever is behind it.

Starter plan3 projects · 2 seats
Team planUnlimited projects · 10 seats
box-shadow:
  0 0 0 1px rgb(34 36 40 / 0.13),
  0 1px 2px rgb(34 36 40 / 0.08),
  0 10px 24px -12px rgb(34 36 40 / 0.34);
The same two cards on a tinted background. A solid gray border boxes them in; a semi-transparent ring and a soft shadow in the ink color separate them from the page and let the background show through the edge.

Under a sticky header, fade the edge instead of drawing a permanent line, and only where content passes under it. (STD-visual-details-15)

A hard line under the header, always

The 1 px divider is there even when nothing is underneath, and it cuts the scrolling content with a sharp edge.

A soft edge where content passes under

The header is translucent and a short fade appears only where content slides beneath it. No permanent line.

A list scrolled under a sticky header. A permanent 1 px divider cuts the content with a hard edge; a translucent header with a short fade where content passes beneath separates the two only where they overlap.

Never place one light, see-through surface on another: text on stacked translucent layers is hard to read. (STD-visual-details-18)

Source: the README and the apple-design skill in emilkowalski/skills.

Targets and focus, measured

TargetAt leastSource
Touch, iOS44 × 44 ptSTD-mobile-touch-09
Touch, Android48 dpSTD-mobile-touch-09
Touch, web44 pxSTD-mobile-touch-09
Any web target, mouse or finger24 × 24 CSS pxAccessibility floor, WCAG 2.2 2.5.8 Target Size (Minimum)

When the drawn control is smaller, grow its hit area, with a pseudo-element on the web or hitSlop in React Native, never the drawing. (STD-mobile-touch-09)

Every focusable element shows a focus ring, 2 px wide, 2 px from the element, with at least 3:1 contrast against its surroundings: a floor from 2.4.7 Focus Visible and 1.4.11 Non-text Contrast.

Set the text in inputs to 16 px or more, or iOS Safari zooms the page on focus and doesn't zoom back. Never turn off pinch zoom to stop it. (STD-mobile-touch-11, STD-accessibility-motion-27)

1 20 · 24 · 44 px
2Continuering 2 px · gap 2 px
3Searchtext 16 px
  1. 1
    Icon button. The icon is drawn at 20 px. Its hit area (dashed) grows to 44 px for touch with a pseudo-element, never by growing the icon. 24 by 24 px (green) is the floor for every web target.
  2. 2
    Focus ring. 2 px wide, 2 px from the edge, and at least 3:1 against what is around it.
  3. 3
    Input text. 16 px or larger, so iOS Safari does not zoom the page when the field gets focus.
Three measurements drawn at actual size: a 20 px icon whose tap area grows to 44 px for touch, over the 24 px floor for every web target; a 2 px focus ring with a 2 px gap; and input text at 16 px, the size below which iOS Safari zooms in.

Source: the mobile-native, animate-expo and apple-design skills in emilkowalski/skills, and Emil Kowalski's Agents with taste.

Color: contrast and meaning

Text on a fill needs at least 4.5:1 contrast, or 3:1 when it is large. OpenDesigner uses the WCAG 2 formula and never rounds up, so 4.49:1 fails. An accessibility floor, from 1.4.3 Contrast (Minimum).

Put color on solid layers, not see-through ones. Over a translucent surface, use higher-contrast text, a slightly heavier weight and a little more letter spacing. (STD-visual-details-21, STD-visual-details-13)

Text that sinks into its fill

Dark text on bright cobalt, white on a pale tint, white on mid gray. Measured, none reaches 4.5:1, the floor for body text.

Publishdark ink on cobalt
#222428 on #2338ff
2.28:1
Draftwhite on a pale tint
#ffffff on #e3ecff
1.18:1
Archivedwhite on mid gray, large text only
#ffffff on #808793
3.61:1

Each fill with its own text color

Each fill gets a text color chosen for it: white on the strong fill, a dark shade of the same hue on the pale ones. Every pair clears 4.5:1.

Publishwhite on cobalt
#ffffff on #2338ff
6.81:1
Draftdark cobalt on a pale tint
#1c31ce on #e3ecff
7.44:1
Paiddark green on a pale green
#00652c on #ebf7ed
6.57:1
Text on colored fills, from this site's own palette, measured with the WCAG 2 formula and never rounded up. Dark text on bright cobalt, white on a pale tint and white on mid gray fail the 4.5:1 floor for body text; pairing each fill with its own text color passes.

Never pair pure white with pure black. Use an off-black such as #111111 with white, or an off-white with black. (STD-visual-details-66)

Keep the colors people already know: green for success, red for errors, amber for pending, blue for information. (STD-visual-details-65)

Source: the apple-design skill in emilkowalski/skills, for translucent surfaces. The last two are OpenDesigner's own house rules.

Build from the tokens

Build from the project's existing tokens, the named values of the system, and extend them when something is missing. Never hand-type or approximate a value, and never start a second, parallel set. (STD-visual-details-26)

Make every spacing, timing and alignment value a choice you can defend. (STD-visual-details-27) Jittery scrolling, misaligned icons or layouts that break on rotation read as carelessness. (STD-visual-details-28)

Source: the prototype, animate and review skills in emilkowalski/skills, and the apple-design skill.

Where these rules come from

The standards file lists each standard with its sources, and Who OpenDesigner learns from describes every source. OpenDesigner is not affiliated with or endorsed by the people it cites.