Computing with CSS layout

Title “Computing with CSS Layout”, subtitle “Bulk math from the browser’s own layout algorithms.”, author’s name, and a bar chart with colored bars of different heights.

Agustin Capeletto uses layout as a calculator to compute without JavaScript. A query container reads its width with 100cqw, round() turns it into a number, and @property carries it on. Grid columns sized auto find the widest item, flex rows add widths, anchor() measures distances, and order sorts values for medians and ranks. In Chrome, indexing, ranking, and sorting this way are 11 to 25 times faster than plain calc().

noscript.ing/compute