Skip to content

[css-grid] when to apply the clamping for fit-content() tracks? #209

@MatsPalmgren

Description

@MatsPalmgren

The specification of fit-content() track sizes is rather vague:
https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content

My understanding is that a "fit-content(X)" track size should behave as
"minmax('auto', 'max-content'))" while running the "Resolve Intrinsic Track
Sizes" algorithm: https://drafts.csswg.org/css-grid/#algo-content
with the additional tweak that if the track's base size becomes larger
than X then it is clamped to X.

Is that correct?

If yes, then I have more questions:

  1. should the clamping be applied at every step of the algorithm, or only
    after the algorithm is done (i.e. between 12.5 and 12.6)?
  2. should the "growth limit" be clamped at any point while running
    the algorithm? (I'm guessing not, since "12.6 Maximize Tracks" says to
    clamp it there, but the spec could be clearer on this)
    https://drafts.csswg.org/css-grid/#algo-grow-tracks

Thanks,
Mats

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions