Skip to content

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

Closed

Description

@fantasai

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.

Activity

  1. mrego commented on Dec 12, 2018

    @mrego
    Member

    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).

  2. removed this from the css-grid-1 CR 2017-12-14+ milestone on Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions