Open fantasai opened 2 months ago
The CSS Working Group just discussed [css-grid-3][masonry] Make auto-fit do things
, and agreed to the following:
RESOLVED: Make auto-fit drop tracks after sizing and placement, and apply content distribution to the tracks again afterward
As Tab pointed out in https://github.com/w3c/csswg-drafts/issues/9041#issuecomment-2075501616,
auto-fit
repeat value is currently defined to behave identically toauto-fill
in masonry. See https://drafts.csswg.org/css-grid-3/#repeat-auto-fitAFAICT the rationale was that we can't redistribute space to the other tracks since placement depends on sizing in masonry layouts.
However, that doesn't mean we can't use the alignment properties to redistribute space, so I think we should allow
auto-fit
to drop columns just as is does in regular Grid layout, and just forbid it from looping back into the track sizing algorithm.This means that, for example, if you have a masonry grid with 3 items but you could fit 6 columns, we'd drop the extra 3 columns and allow you to use
justify-content: space-around
to distribute the columns.