Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-grid-1] Clarify interaction of percentages and intrinsic sizing and the grid algorithm overall #3418

Closed
fantasai opened this issue Dec 11, 2018 · 1 comment

Comments

@fantasai
Copy link
Collaborator

In #1921 (comment) @fantasai wrote:

To clarify, the spec is currently written in conformance with the above resolution (see https://drafts.csswg.org/css-grid-1/#valdef-grid-template-columns-length-percentage and https://drafts.csswg.org/css-grid-1/#intrinsic-sizes). But overall what's happening doesn't seem to be very clearly described.

Afaict, we could describe what is happening as the following (which is then implemented differently in UAs in order to optimize the number of passes):

  1. Size the Grid Container (per axis, for both axes)
  • If it is definite, just get that size.
  • If it is indefinite, run the grid sizing algorithm under min/max-content constraints, treating percentages as auto, in order to find the indefinite size.
  1. Size the Grid

Does this seem correct, or are there shortcuts under #1 that aren't reflected here?

In #1921 (comment) @mrego wrote:

Does this seem correct, or are there shortcuts under #1 that aren't reflected here?

Yes, probably that would be fine, despite Blink/WebKit implementation don't do that. So for us it'll imply an extra pass as described in #1 but probably that's just an implementation detail that shouldn't be considered in the spec.

Pulling this more editorial-level work out into this issue so I can close the main one.

@mrego
Copy link
Member

mrego commented Dec 12, 2018

Note that this comment from @MatsPalmgren might be taken into consideration too:

Given that we sometimes should do two passes of grid sizing, where the first pass is akin to an "intrinsic sizing pass", I think the spec should say explicitly that both passes are supposed to run the algo under "no constraint". And that the grid container's block-axis size is definite and final after the first pass (so that it works similar to the inline-axis).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants