Skip to content

Commit 3a63ab5

Browse files
add fixed size support in autolayout along with flex-shrink: 0
1 parent 29ac016 commit 3a63ab5

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

packages/builder-css-styles/tricks/trick-flex-sizing/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function flexsizing({
3030
case MainAxisSize.max: {
3131
return {
3232
"align-self": "stretch",
33+
width: width && length(width),
34+
height: height && length(height),
3335
};
3436
}
3537
case MainAxisSize.min: {

packages/designto-web/tokens-to-web-widget/compose-wrapped-with-stretched.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function compose_wrapped_with_clip_stretched(
1919
const child = child_composer(widget.child);
2020
child.extendStyle({
2121
"align-self": "stretch",
22+
// TODO: this is required, for fixed width / height to work, but not sure this is the best place to be.
23+
"flex-shrink": 0,
2224
[remove_size]: undefined,
2325
});
2426
return child;

0 commit comments

Comments
 (0)