Skip to content

Commit 51401b1

Browse files
committed
fix button bg image
1 parent e0cf304 commit 51401b1

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/core/src/modals/modalContents/buttonBuilder/ButtonBuilderModalComponent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@
162162
</SettingComponent>
163163

164164
<SettingComponent name="Background image" description="A background image to use in the button.">
165-
<span>{buttonConfig.backgroundImage ?? 'none'}</span>
165+
<span style="word-break: break-word">{buttonConfig.backgroundImage ?? 'none'}</span>
166166
<Button variant={ButtonStyleType.PRIMARY} onclick={() => changeBackgroundImage()} tooltip="Select from vault"
167-
>Select</Button
167+
>Change</Button
168168
>
169169
</SettingComponent>
170170

packages/core/src/utils/components/ButtonComponent.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
class:disabled={disabled}
5858
class:mb-error={error}
5959
style={cssStyle}
60-
style:background-image={backgroundImage}
60+
style:background-image={backgroundImage ? `url("${backgroundImage}")` : undefined}
6161
aria-label={tooltip}
6262
disabled={disabled}
6363
onclick={event => click(event, ButtonClickType.LEFT)}

styles.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ div.mb-view-wrapper {
9999
vertical-align: bottom;
100100
/* Add a gap between text and icons. */
101101
gap: var(--size-4-1);
102+
background-size: cover;
103+
background-position: center center;
102104

103105
&.mod-plain {
104106
background: none;

0 commit comments

Comments
 (0)