Is your feature request related to a problem?
Once a container can wrap into multiple flex lines, there's no way to distribute those lines along the cross axis—they pack to the start. With a 2-wide × 6-tall wrap container holding four single-cell children (two lines of two), the lines sit at the top (rows 0-1), with no way to push them to the end, center them, or space them out.
Describe the solution you'd like
An alignContent layout key that distributes free cross-axis space among the flex lines. For the example, alignContent: "flex-end" should push the two lines to the bottom (rows 4-5).
open("root", {
layout: {
direction: "ltr",
flexWrap: "wrap",
alignContent: "flex-end", // "flex-start" (default) | "flex-end" | "center" | "space-*" | "stretch"
},
});
alignContent should mirror the CSS align-content property. It's inert until there are multiple flex lines, so it depends on multi-line wrapping (#63).
Describe alternatives you've considered
Without renderer support, the only option is to compute line breaks and cross-axis offsets in JS and emit absolutely-positioned rows—which duplicates the layout engine's line-breaking and can't react to a resize.
Additional context
Failing test case on nm/repro/align-content (test · diff).
Clay's Clay_ChildAlignment (in the vendored clay/clay.h) offers only start/center/end on the cross axis; distributing whole flex lines—including the space-between/around/evenly/stretch variants—is a local addition to the layout pass. New string values should line up with the alignment string-literal refactor in #42 (re: #3).
Is your feature request related to a problem?
Once a container can wrap into multiple flex lines, there's no way to distribute those lines along the cross axis—they pack to the start. With a 2-wide × 6-tall wrap container holding four single-cell children (two lines of two), the lines sit at the top (rows 0-1), with no way to push them to the end, center them, or space them out.
Describe the solution you'd like
An
alignContentlayout key that distributes free cross-axis space among the flex lines. For the example,alignContent: "flex-end"should push the two lines to the bottom (rows 4-5).alignContentshould mirror the CSSalign-contentproperty. It's inert until there are multiple flex lines, so it depends on multi-line wrapping (#63).Describe alternatives you've considered
Without renderer support, the only option is to compute line breaks and cross-axis offsets in JS and emit absolutely-positioned rows—which duplicates the layout engine's line-breaking and can't react to a resize.
Additional context
Failing test case on
nm/repro/align-content(test · diff).Clay's
Clay_ChildAlignment(in the vendoredclay/clay.h) offers only start/center/end on the cross axis; distributing whole flex lines—including the space-between/around/evenly/stretch variants—is a local addition to the layout pass. New string values should line up with the alignment string-literal refactor in #42 (re: #3).