Skip to content

[css-grid] fit-content with indefinite percentage #3585

Closed
@Loirooriol

Description

@Loirooriol

According to https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-length-percentage,

If the size of the grid container depends on the size of its tracks, then the <percentage> must be treated as auto, for the purpose of calculating the intrinsic sizes of the grid container and then resolve against that resulting grid container size for the purpose of laying out the grid and its items.

But what if the indefinite percentage is inside fit-content()? https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content doesn't explain this explicitly, and it can't just be treated as auto like in <length-percentage> because fit-content(auto) is not valid syntax.

I guess it should be treated as a normal minmax(auto, max-content), without the special fit-content behavior? That would match this fit-content description:

This is essentially calculated as the smaller of minmax(auto, max-content) and minmax(auto, limit).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions