Skip to content

autoLayout

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. layoutMode, mainAxisAlignment, crossAxisAlignment, wrap, wrapAlignment, itemSpacing

Operands

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

OperandFrom
self.layoutModedocument
self.mainAxisAlignmentdocument
self.crossAxisAlignmentdocument
self.wrapdocument
self.wrapAlignmentdocument
self.itemSpacingdocument

Cases

Ordered — first match wins.

#WhenEmitsWhy
1(self.layoutMode absent or self.layoutMode = NONE)nothingwithout a layout mode the whole rule is inert; the element stays in flow
2self.layoutMode = HORIZONTALdisplay: flex
flex-direction: row
3self.layoutMode = VERTICALdisplay: flex
flex-direction: column

Member cases

Ordered — first match wins.

#WhenEmitsWhy
1self.mainAxisAlignment presentjustify-content: <mapped>
2self.crossAxisAlignment presentalign-items: <mapped>
3self.wrap = trueflex-wrap: wrap
4self.wrap = falseflex-wrap: nowrap
5self.wrapAlignment presentalign-content: <mapped>
6self.itemSpacing present and self.itemSpacing.sign = nonNegativegap: <self.itemSpacing>
7self.itemSpacing present and self.itemSpacing.sign = negativeNOT on this element — a negative margin on <selector> > * + *, emitted by elementRulesgap does not accept negative values; overlap is a sibling margin

css/style/layoutToCSS.ts:39-96; css/sheet/elementRules.ts:254-268. cases decides display and direction; memberCases apply only when a case above emitted a display.