Re: [csswg-drafts] [css-flexbox-1] Clarify how indefinite percentage values are handled in the cross size of flex items (#12018)

In particular: https://drafts.csswg.org/css-flexbox-1/#algo-cross-item

> Determine the hypothetical cross size of each item by performing layout as if it were an [in-flow](https://drafts.csswg.org/css-display-4/#in-flow) [block-level box](https://drafts.csswg.org/css-display-4/#block-level-box) with the used [main size](https://drafts.csswg.org/css-flexbox-1/#main-size) and the given available space, treating [auto](https://drafts.csswg.org/css-sizing-3/#valdef-width-auto) as fit-content.

Could be clearer I guess. Especially since https://drafts.csswg.org/css-sizing-3/#cyclic-percentage-contribution says

> If the cyclic dependency was introduced due to a [block-axis](https://drafts.csswg.org/css-writing-modes-4/#block-axis) size other than a [minimum size](https://drafts.csswg.org/css-sizing-3/#min-width) on the containing block (i.e. a [block-size](https://drafts.csswg.org/css-logical-1/#propdef-block-size) or [max-block-size](https://drafts.csswg.org/css-logical-1/#propdef-max-block-size) in most layout modes, or a [flex-basis](https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis) in [flex layout](https://drafts.csswg.org/css-flexbox-1/#flex-layout)) that causes it to depend on the size of its contents, the box’s percentage is not resolved and instead [behaves as auto](https://drafts.csswg.org/css-sizing-3/#behave-as-auto).
> 
> Note: [Grid items](https://drafts.csswg.org/css-grid-2/#grid-item) and **[flex items](https://drafts.csswg.org/css-flexbox-1/#flex-item) do allow percentages to resolve** in this case.

The note seems wrong, all browsers agree here:

```html
<!DOCTYPE html>
<div style="display: inline-flex; border: solid">
  <div style="width: 100px; height: 100px; border: solid cyan"></div>
  <div style="width: 100px; height: 50%; border: solid magenta"></div>
</div>
```

![](https://github.com/user-attachments/assets/cd68fdf6-504f-46f1-a86e-91fdb791fdb0)


-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12018#issuecomment-2762512744 using your GitHub account


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

Received on Friday, 28 March 2025 21:04:43 UTC