373. A column starts from nothing and grows
Date: 2026-09-17
Status
Accepted. Closes book/src/TODO.md’s “flex-basis is one of two layout
properties §8 names and nothing resolves”.
Context
§8 has listed flex-grow, flex-shrink and flex-basis from the beginning.
The first two are resolved; the third was implemented for segmented and taken
back out, because flex-basis: 0 on a track inside an unconstrained row makes
Yoga compute that row’s content size as zero and the bar collapsed.
Two widgets have wanted it since and written around it:
masonryneeds1/nof a row wherenis a count no selector can make. It wrote an inlinewidth: 100/n %instead — which is1/nof the row before its gaps, so three columns and two 12px gaps overflowed by 24px.timeline.alternatewants half a row per side and writeswidth: 50%with an equal shrink, which is the same arithmetic and the same overflow.
The thing that collapsed was never the property: it was flex-basis: 0 on a box
whose parent had no definite main size, which is CSS’s behaviour too.
Decision
flex-basis is resolved, as a Length on ComputedStyle and on Box, and
masonry is its first consumer.
autois the initial value — Yoga’s and CSS’s — so a box that never mentions it lays out exactly as before. It is a value rather than a missing one: it undoes a more general rule, which isalign-self: auto’s argument (ADR-0244).Box.basis(Length)is the builder, andRenderObjectsets it on the node the same waywidthis set: only when it differs from the previous frame.masonry-columnisflex-basis: 0; flex-grow: 1incontrols.css, andMasonryColumnno longer takes a count or writes arestyle. The columns are now a share of what the gaps left rather than of the whole row.
Consequences
- The collapse that took this out is still real and is now the author’s to avoid:
flex-basis: 0in a row with no definite main size sizes that row to nothing. Thesegmentedbar keeps the grid ADR-0099 gave it. RecordWitherTestcovers the new component on both records for free.timeline.alternateis left as it is: its percentage is of a row it does not share with a gap, so the arithmetic is the same and the change would only move goldens.