Skip to content

Commit

Permalink
[css-grid-2] Remove issue about masonry layout; discussion is happeni…
Browse files Browse the repository at this point in the history
…ng in #945 and it's not entirely clear it's a Grid issue.
  • Loading branch information
fantasai committed Jan 24, 2018
1 parent ef68539 commit 5b00b7c
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions css-grid-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -362,50 +362,3 @@ Aspect-ratio&ndash;controlled Gutters</h2>
}
</pre>
</div>

<!--
██ ██ ███ ██████ ███████ ██ ██ ████████ ██ ██
███ ███ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██
████ ████ ██ ██ ██ ██ ██ ████ ██ ██ ██ ████
██ ███ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ████████ ██
██ ██ █████████ ██ ██ ██ ██ ████ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██
██ ██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██
-->

<h2 id=masonry>
Masonry Layout</h2>

<div class=issue>
People have been trying to use CSS for <a href="https://github.com/w3c/csswg-drafts/issues/1009#issuecomment-278095001">masonry layouts</a> for over a decade,
and it doesn't seem to have slowed,
so it's probably not just a layout fad.
Would probably be worthwhile to address officially.

As far as I can tell,
this is best done as a Grid feature;
some of the features I've seen in masonry libraries
(like large items spanning multiple masonry tracks)
make Flexbox inappropriate.
This also would reuse *so many* Grid features
that it would be a shame to put together a brand new layout spec for it.

No clue what it would look like yet, tho.
In handwavey terms, it's a grid that's only gridded
"in one dimension",
and free-flows in the other,
with auto-flow.

Note that this is actually 100% possibly with Grid today,
if your items are of known height,
by making thousands of 1px tall rows,
and setting the items' row-span to be equal to their height in px.
(Or some lower-res multiple, like 10px rows.)
Dense row auto-flow then magically makes Masonry happen.
This is just a terrible hack that runs into memory/CPU issues
due to the large number of rows.
It suggests, tho,
that making it work properly
is mostly a matter of relaxing some constraints,
rather than adding entirely new behavior.
</div>

0 comments on commit 5b00b7c

Please sign in to comment.