Skip to content

[css-grid] fit-content() definition not clear #3569

Closed
@Loirooriol

Description

@Loirooriol

From https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content,

  • fit-content( <length-percentage> )
    Represents the formula min(max-content, max(auto, argument)), which is calculated like minmax(auto, max-content), except that the track size is clamped at argument if it is greater than the auto minimum.

This definition seems very confusing to me. For starters, auto has different meaning as a minumim than as a maximum, so it's not clear how min(max-content, max(auto, argument)) should be calculated.

In "the track size is clamped at argument", it's not clear whether this is a flooring or a ceiling. Usually "clamp" refers to an interval, not a single value.

In "if it is greater" it's not clear whether "it" refers to argument or to the track size.

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