Re: [csswg-drafts] [css-flexbox-2] Add flex-wrap: dense (#3071)

> dense flexbox packing - every item, rather than being placed at the end of the last line, is instead placed at the end of the first line the item can fit in. This way, if a large item gets wrapped to the next line, leaving a decent amount of space behind, a small following item can scootch up and fill that space, rather than just having the remaining items get a ton of free space and flex really big.

I'm a bit concerned about this formulation of "dense" flexbox packing, and to-what-extent it's useful vs. weird.

A few weird behaviors that I'm imagining:
1. The start of each line would tend to contain ~whatever, vs. the end of each line would tend to have 1-2 very small items.  This would make lines look "lopsided".

2. The small items that get densely-placed at the end of each flex-line would tend to feel very "unstable".  If you resize your browser window, or if a font/image loads and sizes change slightly, then those small items would suddenly snap to their in-flow position which would potentially be much later.
 
3. The interaction with `order` might be weird.  E.g. if you're using this for a toolbar and you have one button that you want to always be at the end (e.g. maybe an "Add more tools..." button) you might expect that setting a large `order` would force it to be last, but that would fail if this item happens to be chosen to fit on an earlier row.

4. Related to `order`, we need to be sure painting order is well-defined when items get shifted around like this.

Item 1 here is specific to "dense" packing in flexbox, I think.

Items 2,3,4 are arguably things that already happen (or similarly-need-to-and-probably-already-are-defined) with "dense" packing in grid, though they might manifest slightly differently or more-noticeably in flexbox.

-- 
GitHub Notification of comment by dholbert
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3071#issuecomment-2628130539 using your GitHub account


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

Received on Friday, 31 January 2025 19:24:53 UTC