W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

[csswg-drafts] [css-grid] Can the sizing algo be made to deal with this

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Sat, 24 Feb 2018 04:03:37 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-299909400-1519445016-sysbot+gh@w3.org>
frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid] Can the sizing algo be made to deal with this ==
I just ran into a case that grid sizing ought to be able to deal with, but apparently cannot.

test: https://florian.rivoal.net/csswg/grid/grid-span-auto-001.html
reference: https://florian.rivoal.net/csswg/grid/grid-span-auto-001-ref.html

This is  grid with a few auto sized columns, and a bunch of elements spanning them in various ways. Given the size of the various things in it, it can be densely packed (as seen in the reference, with manually calculated sizes), but the current sizing algo leaves a bunch of unnecessary white space.

The motivating use case for this was trying to use grid to layout comics / manga (so it may become massively common if/when the Japanese Manga publishers starts using Grid). Since the browser has all the information it needs to calculate the "ideal" layout, grid should be able to handle that.

Finding the "correct" size doesn't seem to involve any particularly difficult math either. You cannot solve this by only resolving the (min/max) sizes of individual tracks, you also need to do the same for any pair of grid lines that items span between, but once you do that, you just have a simple system of linear equations to solve.

Now, if a grid item spans across several tracks which have different intrinsic sizing functions (like one column being max-content, and the other being min-content), I'm not 100% sure what the semantics are. But at least if all the columns it spans across have the same intrinsic sizing function, there should be no problem.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2356 using your GitHub account
Received on Saturday, 24 February 2018 04:04:14 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC