Hacker News new | ask | show | jobs
by nicoburns 1062 days ago
I do often end up using Flexbox for 1-dimensional layouts, but IMO Grid's fr units are a lot more intuitive than Flexbox's combination of flex-basis/flex-grow/flex-shrink. If CSS added a 1-dimensional layout mode based on these principles then I'd switch to it in a heartbeat.

(I'm considering proposing one myself).

1 comments

What bugs me the most is Flex centering absolutely sucks at handling overflow. Have a flex box with content that is supposed to be centered? Great, looks perfect for the first few items. But then try it on a smaller window or with more items and the content overflowing to the left of the border will be entirely inaccessible.

Allowing scrolling both ways would have been perfect. Switching to left-aligned when content overflows would be acceptable. But completely prohibiting access to half the content when an overflow occurs? Absolutely asinine.

I believe there may be ways to get around this with layers of inner divs and weird `overflow: ` incantations, but that's exactly the kind of bullshit flex was supposed to solve.

See https://developer.mozilla.org/en-US/docs/Web/CSS/align-items. If you need to enable a "safe" mode to prevent data loss, and that isn't supported on any mainstream browsers... you fucked up.