Lexicon / Scroll behaviour · 1 of 11

14 / Scroll behaviour

Scroll Snap

Scrolling comes to rest on a whole page instead of halfway between two. It feels like turning the pages of a book.

Twelve months, a page each

The calendar of the Très Riches Heures, painted for the Duke of Berry by the Limbourg brothers about 1412–16. Scroll the book: it always comes to rest on a whole month. The mark beside it shows where you really are.

The Très Riches Heures, Janvier: The Duke of Berry at his New Year’s feast.

I

Janvier

Capricorn · Aquarius

The Duke of Berry at his New Year’s feast.

The Très Riches Heures, Février: Snow on a farmyard: three warm themselves at the fire while a man cuts wood outside.

II

Février

Aquarius · Pisces

Snow on a farmyard: three warm themselves at the fire while a man cuts wood outside.

The Très Riches Heures, Mars: Ploughing, pruning and sowing below the Château de Lusignan.

III

Mars

Pisces · Aries

Ploughing, pruning and sowing below the Château de Lusignan.

The Très Riches Heures, Avril: A betrothal in a walled garden, the Château de Dourdan behind.

IV

Avril

Aries · Taurus

A betrothal in a walled garden, the Château de Dourdan behind.

The Très Riches Heures, Mai: A May ride through the woods, the riders crowned with leaves.

V

Mai

Taurus · Gemini

A May ride through the woods, the riders crowned with leaves.

The Très Riches Heures, Juin: Haymaking before the Palais de la Cité and the Sainte-Chapelle.

VI

Juin

Gemini · Cancer

Haymaking before the Palais de la Cité and the Sainte-Chapelle.

The Très Riches Heures, Juillet: Harvesting the wheat and shearing sheep below the palace at Poitiers.

VII

Juillet

Cancer · Leo

Harvesting the wheat and shearing sheep below the palace at Poitiers.

The Très Riches Heures, Août: Falconers ride out; swimmers in the river below the Château d’Étampes.

VIII

Août

Leo · Virgo

Falconers ride out; swimmers in the river below the Château d’Étampes.

The Très Riches Heures, Septembre: The grape harvest below the Château de Saumur.

IX

Septembre

Virgo · Libra

The grape harvest below the Château de Saumur.

The Très Riches Heures, Octobre: Sowing winter wheat before the Louvre.

X

Octobre

Libra · Scorpio

Sowing winter wheat before the Louvre.

The Très Riches Heures, Novembre: A swineherd knocks down acorns for his pigs.

XI

Novembre

Scorpio · Sagittarius

A swineherd knocks down acorns for his pigs.

The Très Riches Heures, Décembre: The boar hunt at bay, the Château de Vincennes behind the trees.

XII

Décembre

Sagittarius · Capricorn

The boar hunt at bay, the Château de Vincennes behind the trees.

  1. IJanvier
  2. IIFévrier
  3. IIIMars
  4. IVAvril
  5. VMai
  6. VIJuin
  7. VIIJuillet
  8. VIIIAoût
  9. IXSeptembre
  10. XOctobre
  11. XINovembre
  12. XIIDécembre

The Limbourg brothers · about 1412–16 · Musée Condé, Chantilly, MS 65

also called snap points · scroll snapping

Two properties, and it inherits the platform's real scroll physics — momentum, rubber-banding, trackpad feel. Every JavaScript reimplementation is worse. Two properties, and the book inherits the platform’s own scrolling: momentum, a trackpad’s feel, the keyboard, a flick that carries it three months at once and still lands on a whole one. The index beside it moves with the scroll itself, so you can watch the page settle where the scroll would not.

How it is built.book { overflow-y: auto; scroll-snap-type: y mandatory; /* the book comes to rest… */ scroll-timeline: --book } .page { scroll-snap-align: start } /* …on a whole page */ .months::after { animation: turn linear; animation-timeline: --book } /* where you really are */

In full, on GitHub index.html showcase.css

Pages — the Très Riches Heures du Duc de Berry, calendar, painted by the Limbourg brothers about 1412–16 and finished in 1485–89 by Jean Colombe; Musée Condé, Chantilly; public domain, via Wikimedia Commons: Janvier, Février, Mars, Avril, Mai, Juin, Juillet, Août, Septembre, Octobre, Novembre, Décembre. Facts — Très Riches Heures du Duc de Berry.