Calculus of interfaces

Proof-carrying layout

The card grid below is not hand-placed. It is one math function of the screen and the design. Because it is a function, this page can prove rules on every screen, find every jump, and repair a design that breaks.

Building the function on this device…

1. The function

Eleven cards, a column count, line wraps, a 4-line clamp, a page height and four rules: all written as one straight list of operations, with no loops and no ifs.

Show the whole function

  

2. Try it

The real page, laid out by your browser's CSS. Dashed outlines are where the function says each card goes.

Screen and design

Start design

3. Prove it

Not a sample of screens: every screen from 320 to 1600 px wide, at every font size from 0.85 to 1.30. The prover bounds the function over whole boxes of screens and splits a box only when it cannot decide.

Rules to prove

Rules
Prove

320 pxwidth1600 px

4. Repair it

When a rule fails, the page searches for the smallest change to the design that passes. Gradient descent proposes; the prover checks every screen; any screen that still fails is added to the training set; repeat.

Repair the design

Repair
Use result

5. Where it jumps

Between jumps the layout moves smoothly. The jumps (a column appears, a line wraps) are steps in the function, so the page finds every one exactly instead of sampling.

Jumps across widths

320 pxwidth1600 px

    6. Check the checker

    A proof is only as good as the function and the bounds. Three tests, run here on your device: the function against your browser, the bounds against the function, and the proof against the function.

    Run the checks

    Run checks

    Limits

    Sources