Skip to content

[css-sizing] Define fit-content using clamp() #4006

@Loirooriol

Description

@Loirooriol

https://drafts.csswg.org/css-sizing-3/#fit-content-size defines fit-content as

min(max-content size, max(min-content size, stretch-fit size))

At first sight it may not be completely obvious what that formula represents. To avoid this kind of confusions, css-values added clamp(), so why not use it?

clamp(min-content size, stretch-fit size, max-content size)

Seems clearer to me. (Note the desugaring is different, but this doesn't matter because min-content <= max-content)

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