Skip to content

Commit

Permalink
Ensure non-form elements are correctly positioned when scale is appli…
Browse files Browse the repository at this point in the history
…ed (#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>
  • Loading branch information
hannahblair and gradio-pr-bot authored Nov 4, 2024
1 parent a1582a6 commit 6c8a064
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/shy-signs-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/atoms": patch
"gradio": patch
---

fix:Ensure non-form elements are correctly positioned when scale is applied
4 changes: 4 additions & 0 deletions js/atoms/src/Block.svelte
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 6c8a064

Please sign in to comment.