Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Loirooriol opened this issue Jan 29, 2019 · 3 comments
Closed

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

Loirooriol opened this issue Jan 29, 2019 · 3 comments
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1

Comments

@Loirooriol
Copy link
Contributor

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.

@fantasai
Copy link
Collaborator

How about
“Represents the formula max(minimum, min(limit, max-content)) where minimum represents an auto minimum (which is often, but not always, equal to a min-content minimum) and limit is the argument to fit-content(). This is essentially calculated as the smaller of ''minmax(auto, max-content)'' and ''minmax(auto, limit)''.”
?

@Loirooriol
Copy link
Contributor Author

That's much, much better, thanks!

@fantasai
Copy link
Collaborator

Done.

@fantasai fantasai added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1
Projects
None yet
Development

No branches or pull requests

2 participants