Skip to content

[css-grid] Distribute extra space into non-intrinsic tracks instead of going beyond growth limits #3648

@Loirooriol

Description

@Loirooriol

From https://drafts.csswg.org/css-grid/#extra-space,

  1. Distribute space to base sizes up to growth limits: Find the item-incurred increase for each spanned track with an affected size by: distributing the space equally among such tracks
  2. Distribute space beyond growth limits: If space remains after all tracks are frozen, unfreeze and continue to distribute space

However, the item could be spanning a track without intrinsic sizes whose base size still hasn't reached its growth limit. Wouldn't it make more sense to increase the base size of such track before increasing intrinsic tracks beyond growth limits?

For example, https://jsfiddle.net/phrwn2cd/

.grid {
  display: grid;
  grid-template-columns: minmax(0, 100px) minmax(auto, 100px);
  width: 0;
}
.item {
  grid-column: 1 / 3;
  width: 250px;
  height: 100px;
  background: cyan;
}

The columns are 0px 250px but instead I would expect 100px 150px, i.e.

  1. Distribute space to affected base sizes up to growth limits
  2. Distribute space to non-affected base sizes of spanned tracks up to growth limits
  3. Distribute space beyond growth limits

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Unsorted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions