[csswg-drafts] [css-flexbox-1] Clarify fit-content behavior when the available space in a given axis is indefinite (#11414)

gitspeaks has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-flexbox-1] Clarify fit-content behavior when the available space in a given axis is indefinite ==
According to [CSS Flexible Box Layout Module, Section 9.4(7)](https://drafts.csswg.org/css-flexbox-1/#algo-cross-item):

> Determine the hypothetical cross size of each item by performing layout with the used main size and the [cross-axis*] available space, treating `auto` as `fit-content`.

However, according to the [CSS Box Sizing Module Level 3, Section 2.1](https://drafts.csswg.org/css-sizing-3/#fit-content-inline-size), the `fit-content` size in a given axis depends on the available space being **definite**:



> If the available space in a given axis is definite, equal to clamp(min-content size, stretch-fit size, max-content size) (i.e. max(min-content size, min(max-content size, stretch-fit size)))
>
> 

In particular, [stretch-fit size](https://drafts.csswg.org/css-sizing-3/#stretch-fit-size) is:

> Undefined if the available space is indefinite. 

and

> Calculations involving this size need to specify a fallback behavior for when the available space is indefinite if that happens to be possible.



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:

- Writing Mode: horizontal-tb
- Flex Direction: row
- Flex Container and Flex Items: Both have `height: auto`.

How should the `fit-content` size for the **cross axis (height)** of the flex item be determined?



(*) Added for clarification purposes.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11414 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 25 December 2024 12:43:14 UTC