[csswg-drafts] [css-flexbox] Resolving flex item ‘auto’ preferred size for max-content contribution (#6455)

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

== [css-flexbox] Resolving flex item ‘auto’ preferred size for max-content contribution ==
I’m trying to figure out how to resolve an `auto` preferred size of a flex item to calculate its [max-content contribution](https://drafts.csswg.org/css-flexbox-1/#intrinsic-item-contributions) as part of calculating the `max-content` [intrinsic main size of a flex container](https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes).

[§ 9.9.3. Flex Intrinsic Size Contributions](https://drafts.csswg.org/css-flexbox-1/#intrinsic-item-contributions) specifies the following:

> The main-size max-content contribution of a flex item is the larger of its outer max-content size and **outer preferred size (its width/height as appropriate)** clamped by its flex base size as a maximum (if it is not growable) and/or as a minimum (if it is not shrinkable), and then further clamped by its min/max main size.

My flex item has `width: auto`. [CSS-SIZING-3](https://www.w3.org/TR/css-sizing-3/#valdef-width-auto) defers to the *relevant layout module* to calculate this. But the main size of a flex item is determined via `flex-basis` and the Flexbox layout algorithm. So if `flex-basis` is anything else than [`auto`](https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-auto) (in which case it does look at `width`), `width` seems to be effectively ignored.

How should I resolve a preferred size (`width` or `height`) of `auto` for a flex item? Should I follow the same steps as the steps for determining the *flex base size* outlined in [§ 9.2.3.E Determine the flex base size and hypothetical main size of each item](https://drafts.csswg.org/css-flexbox-1/#algo-main-item)? Where we ultimately look at the `max-content` size of an item?




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


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

Received on Thursday, 15 July 2021 09:26:48 UTC