Skip to content

autoLayoutSizing

disposition: bound, basis: implementation

A rule of the CSS binding. These keys resolve jointly — no one of them determines any single output, so the rule below is the mapping.

Keys. layoutSizingHorizontal, layoutSizingVertical

Operands

Every fact the rule reads. Nothing outside this set participates.

OperandFrom
self.layoutSizingHorizontaldocument
self.layoutSizingVerticaldocument
self.clipsContentdocument
self.maxLinesdocument
self.widthdocument
self.heightdocument
parent.layoutModedocument (ancestor)
parent.crossAxisAlignmentdocument (ancestor)
context.isInstanceemitter context
context.isDefaultBlockemitter context

Derived predicates

NameExpressionSource
derived.mainHugscontext.isInstance = false and self.clipsContent ≠ true and self.maxLines absentlayoutToCSS.ts:133-134
derived.crossStretchescontext.isInstance = false and (parent.crossAxisAlignment absent or parent.crossAxisAlignment = STRETCH)layoutToCSS.ts:130-131

Cases

Ordered — first match wins.

#WhenEmitsWhy
1self.layoutSizingHorizontal = HUG and parent.layoutMode = HORIZONTAL and derived.mainHugs = truenothingthe parent main axis already hugs
2self.layoutSizingHorizontal = HUGwidth: fit-content
3self.layoutSizingHorizontal = FILL and parent.layoutMode = HORIZONTALflex: 1 0 0
4self.layoutSizingHorizontal = FILL and parent.layoutMode = VERTICAL and derived.crossStretches = truenothingthe parent stretches it across the cross axis already
5self.layoutSizingHorizontal = FILLwidth: 100%
6self.layoutSizingVertical = HUG and parent.layoutMode = VERTICAL and derived.mainHugs = truenothing
7self.layoutSizingVertical = HUGheight: fit-content
8self.layoutSizingVertical = FILL and parent.layoutMode = VERTICALflex: 1 0 0
9self.layoutSizingVertical = FILL and parent.layoutMode = HORIZONTAL and derived.crossStretches = truenothing
10self.layoutSizingVertical = FILLheight: 100%
11(parent.layoutMode = HORIZONTAL or parent.layoutMode = VERTICAL) and (context.isDefaultBlock = true or self.layoutSizingHorizontal present or self.layoutSizingVertical present or self.width present or self.height present) and self.layoutSizingOnParentAxis ≠ FILLflex-shrink: 0stated sizing on a flex child that is not FILL must not shrink

Otherwise

Nothing is emitted. — FIXED or absent contributes nothing from this rule

css/style/layoutToCSS.ts:130-179. Cases are ordered and the first match wins. self.layoutSizingOnParentAxis is the axis-selected key the source computes from parentLayoutMode.