[csswg-drafts] [css-flexbox] Flex lines count (#13414)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-flexbox] Flex lines count ==
We [just resolved](https://github.com/w3c/csswg-drafts/issues/3070) to add `flex-wrap: balance`, but deferred resolving on exactly how to ensure that you balance across a certain minimum amount of lines.

The use-case is something like the Wikipedia references section, which on most desktop screens lays out across two columns. Today, that's done with Multicol balancing + break-inside:avoid, and is very expensive as a result (fragmentation is hard). Switching to Flexbox, with a `flex-wrap: balance 2`, would solve much more efficiently.

@fantasai's main objection is twofold, I think:

1. We should have similar functionality to Multicol, where you can specify the number of columns *or* the minimum width of the columns; the latter will compute a number from the available space.
2. We should have the line-count control apply as a more general property of Flexbox, not shoved into flex-wrap:balance.

I agree with (1), definitely. The Wikipedia use-case even shows that off; if you zoom enough, it eventually switches to a single column. That's done with an MQ today, but it would be nice to have it be done purely through the balance declaration. (And on very wide screens, it could enable more than two columns, rather than sticking with two very wide ones. In practice, Wikipedia limits its content area size anyway to maintain reasonable line lengths, so that side probably isn't an issue.)

I'm less sure about (2), but not opposed to a good argument. I'm just not sure what having a more general flex-line control would *do*, outside of balancing.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13414 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 30 January 2026 00:10:39 UTC