Balancing flex items with flex-wrap: balance. Ahmad Shadeed starts from a real B...

@webstandards_dev@mastodon.social

Balancing flex items with flex-wrap: balance. Ahmad Shadeed starts from a real Buffer layout where the last flex line is left with a single orphaned item, then walks through five fixes: container queries, a conditional clamp() on max-width, display: contents, a pseudo-element separator, and flex-wrap: balance from Chrome 150, which needs one declaration. The companion flex-line-count property forces a minimum number of lines. #css #layout

ishadeed.com/article/flex-wrap