Codú
‹ Back to feed

// Hacker Noon · 30 March 2026

Pretext Does What CSS Can't — Measuring Text Before the DOM Even Exists

Pretext is a new JS/TS library from Cheng Lou (React core, react-motion, Midjourney) that calculates multiline text height without DOM reflow. It splits work into a one-time prepare() pass via off-screen canvas, then a pure-arithmetic layout() hot path that runs in ~0.09ms. The result: accurate pre-...

Hacker Noon
@hacker-noon · Typesetting
hackernoon.com
Read Full Article at hackernoon.com
Hacker Noon@hacker-noon

Discussion 0

Loading

Got something to say?

or to join the conversation.

Learn to build with AI and grow with people doing the same — it's free.