-
Notifications
You must be signed in to change notification settings - Fork 711
[css-flexbox-1] Clarify fit-content behavior when the available space in a given axis is indefinite #11414
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
Comments
That isn't specific to flexbox, you removed it but the quote even says "as if it were an in-flow block-level box". https://drafts.csswg.org/css-sizing-3/#fit-content-size
Also see #10721 |
I didn't remove anything. I mistakenly included a link to the draft instead of the published version, where it clearly states:
This is how the specification should be read as published. |
Just to confirm I understand correctly, the process is: Treat the flex item as a block-level box in flow layout, where the available space in the main direction is determined by the previously calculated main size. Since the flex item's cross size is set to Is that correct? |
The calculated main size is used as the main-axis size of the item, not as the available space in the main-axis. |
My intention was: 'available space' for the block-level box in a flow layout. For horizontal-tb / row, read: Treat the flex item as a block-level box in flow layout, where the available space in the inline direction (for the block-level box in flow layout) was determined by the previously calculated inline size of that box when it was considered a 'flex item.' |
According to CSS Flexible Box Layout Module, Section 9.4(7):
However, according to the CSS Box Sizing Module Level 3, Section 2.1, the
fit-content
size in a given axis depends on the available space being definite:In particular, stretch-fit size is:
and
This raises a question: How should the
fit-content
value be determined for a flex item in situations where the [cross-axis*] available space is indefinite?Consider the following scenario:
height: auto
.How should the
fit-content
size for the cross axis (height) of the flex item be determined?Note: This step takes place after Section 9.7
(*) Added for clarification purposes.
The text was updated successfully, but these errors were encountered: