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 <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Hannah 2024-11-04 17:23:40 +00:00 committed by GitHub
parent a1582a6dca
commit 6c8a064fee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/atoms": patch
"gradio": patch
---
fix:Ensure non-form elements are correctly positioned when scale is applied

View File

@ -59,6 +59,7 @@
style:flex-grow={scale}
style:min-width={`calc(min(${min_width}px, 100%))`}
style:border-width="var(--block-border-width)"
class:auto-margin={scale === null}
>
<slot />
</svelte:element>
@ -74,6 +75,9 @@
background: var(--block-background-fill);
width: 100%;
line-height: var(--line-sm);
}
.auto-margin {
margin-left: auto;
margin-right: auto;
}