Skip to content

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

Closed
@andyjakubowski

Description

@andyjakubowski

I’m trying to figure out how to resolve an auto preferred size of a flex item to calculate its max-content contribution as part of calculating the max-content intrinsic main size of a flex container.

§ 9.9.3. Flex Intrinsic Size Contributions specifies the following (emphasis mine):

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 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 (in which case it does look at width or height as appropriate), width or height 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? Where we ultimately look at the max-content size of an item if flex-basis: auto and width: auto (or height: auto)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions