flex-basis:auto Content Size Note

Resolve flex-basis:auto from independently computed main-size property; auto main size uses independently obtained content basis. Not intrinsic size measurement or min-size freezing. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.

Description

An automatic flex basis can use a definite main size or fall back to a content basis.

An automatic flex basis can use a definite main size or fall back to a content basis.1

Both sizes must already be established under the relevant layout conditions. Use flex-basis:auto Content Size Note to evaluate the supplied inputs under the specific model below.

When to use flex-basis:auto Content Size Note

Use flex-basis:auto Content Size Note to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.

How to use flex-basis:auto Content Size Note and understand its results

  1. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
  2. Enter Computed main size px, Main size is auto, Independently measured content basis px using the field table and validation rules below, then run the tool.
  3. Read Resolved auto flex basis px and interpret units, signs, ordering and placeholders as explained below.
  4. If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
Input fieldMeaningValue typeRequirement
computedMainSizePxComputed main size pxnumberRequired; constraints below
mainSizeIsAutoMain size is autobooleanRequired; constraints below
independentlyMeasuredContentBasisPxIndependently measured content basis pxnumberRequired; constraints below

Enter nonnegative content size and independently computed basis size in px, plus an auto-basis flag. Auto selects the supplied content size; otherwise return the supplied computed basis. This bounded selector does not resolve the main-size property, intrinsic sizing or CSS cascade.

selectedBasisPx = isAuto ? contentSizePx : computedBasisPx

Field order, units and branch conditions follow the implementation explanation above.

Output fieldMeaningValue type
resolvedAutoFlexBasisPxResolved auto flex basis pxnumber
json
{
  "input": {
    "computedMainSizePx": 100,
    "mainSizeIsAuto": false,
    "independentlyMeasuredContentBasisPx": 50
  },
  "output": {
    "resolvedAutoFlexBasisPx": 100
  }
}

Limitations and assumptions

Both sizes must already be established under the relevant layout conditions. Apply the exact scope and assumptions described above.

All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.

Alternative or Complementary methods

Use mask-image Alpha vs Luminance Mode Lookup for a related task: Mask coverage can depend on alpha alone or on luminance multiplied by alpha.

Use flex:none Shorthand Expansion for a related task: Flex none selects an inflexible automatic basis under its shorthand expansion.

References

  1. flex-basis:auto Content Size Note — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies