by basil-rash · 2y ago · 0 comments
Anyone who says flexbox “solved” centering hasn’t been paying attention.
It blows my mind that this is the “best” (or at least most ubiquitous) layout engine in existence.
Edit: to be more constructive, can anyone offer the OP a concise, CSS-only, diff that would fix the mobile issue without changing the DOM structure or layout on larger screens? It might be possible with a min-width: fit-content, but I have no development setup available at the moment.
and maybe, if you want, a `min-width` on the boxes themselves
It’s sad that this had been up for so long with no real solutions. A genuine failure of the CSSWG.
In this case, I'd probably switch to an automatic grid layout with equal size boxes regardless of content size. Then it could neatly wrap into multiple rows while keeping the boxes at a constrained size.