Skip to content

Commit 6c8a064

Browse files
Ensure non-form elements are correctly positioned when scale is applied (#9882)
* apply margin when scale is null * remove console.log * add changeset --------- Co-authored-by: gradio-pr-bot <[email protected]>
1 parent a1582a6 commit 6c8a064

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/shy-signs-taste.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@gradio/atoms": patch
3+
"gradio": patch
4+
---
5+
6+
fix:Ensure non-form elements are correctly positioned when scale is applied

js/atoms/src/Block.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
style:flex-grow={scale}
6060
style:min-width={`calc(min(${min_width}px, 100%))`}
6161
style:border-width="var(--block-border-width)"
62+
class:auto-margin={scale === null}
6263
>
6364
<slot />
6465
</svelte:element>
@@ -74,6 +75,9 @@
7475
background: var(--block-background-fill);
7576
width: 100%;
7677
line-height: var(--line-sm);
78+
}
79+
80+
.auto-margin {
7781
margin-left: auto;
7882
margin-right: auto;
7983
}

0 commit comments

Comments
 (0)