diff --git a/demo/blocks_joined/run.py b/demo/blocks_joined/run.py index 4800f014a7..56969e43e2 100644 --- a/demo/blocks_joined/run.py +++ b/demo/blocks_joined/run.py @@ -33,7 +33,6 @@ with gr.Blocks(css=".container { max-width: 800px; margin: auto; }") as demo: label="Enter your prompt", show_label=False, max_lines=1 ).style( border=(True, False, True, True), - margin=False, rounded=(True, False, False, True), container=False, ) diff --git a/gradio/components.py b/gradio/components.py index 2adfae5ee7..ee78aa2403 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -3615,9 +3615,12 @@ class Button(Clickable, Component): rounded: Optional[bool | Tuple[bool, bool, bool, bool]] = None, full_width: Optional[str] = None, border: Optional[bool | Tuple[bool, bool, bool, bool]] = None, + margin: Optional[bool | Tuple[bool, bool, bool, bool]] = None, ): if full_width is not None: self._style["full_width"] = full_width + if margin is not None: + self._style["margin"] = margin return IOComponent.style( self, diff --git a/ui/packages/app/src/components/Group/Group.svelte b/ui/packages/app/src/components/Group/Group.svelte index dc7eacab2b..835b0dbe43 100644 --- a/ui/packages/app/src/components/Group/Group.svelte +++ b/ui/packages/app/src/components/Group/Group.svelte @@ -14,18 +14,18 @@ diff --git a/ui/packages/atoms/src/Block.svelte b/ui/packages/atoms/src/Block.svelte index c1cfd89ea8..080cf63929 100644 --- a/ui/packages/atoms/src/Block.svelte +++ b/ui/packages/atoms/src/Block.svelte @@ -61,7 +61,7 @@ (typeof style.rounded === "boolean" && style.rounded); $: rounded_style = get_styles({ rounded: rounded }, ["rounded"]).classes; - $: visible_style = get_styles({ visible }, ["visible"]); + $: visible_style = get_styles({ visible }, ["visible"]).classes; - import { create_classes } from "../../utils"; + import { create_classes, get_styles } from "../../utils"; import type { Styles } from "@gradio/utils"; export let style: Styles = {}; @@ -7,12 +7,19 @@ export let visible: boolean = true; export let variant: "primary" | "secondary" = "secondary"; export let size: "sm" | "lg" = "lg"; + + $: ({ classes } = get_styles(style, [ + "border", + "full_width", + "rounded", + "margin" + ]));