Skip to content

Commit 181e9a0

Browse files
committed
Move btn content to CSS var (#54)
1 parent 6fd3d4c commit 181e9a0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ToastItem.svelte

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ onDestroy(() => {
8585
{/if}
8686
</div>
8787
{#if item.dismissable}
88-
<div class="_toastBtn pe" role="button" tabindex="-1" on:click={close}>✕</div>
88+
<div class="_toastBtn pe" role="button" tabindex="-1" on:click={close} />
8989
{/if}
9090
<progress class="_toastBar" value={$progress} />
9191
</div>
@@ -123,15 +123,18 @@ onDestroy(() => {
123123
pointer-events: auto;
124124
}
125125
._toastBtn {
126-
width: 2rem;
127-
height: 100%;
128-
font: 1rem sans-serif;
126+
width: var(--toastBtnWidth, 2rem);
127+
height: var(--toastBtnHeight, 100%);
128+
font: var(--toastBtnFont, 1rem sans-serif);
129129
display: flex;
130130
align-items: center;
131131
justify-content: center;
132132
cursor: pointer;
133133
outline: none;
134134
}
135+
._toastBtn::after {
136+
content: var(--toastBtnContent, '');
137+
}
135138
._toastBar {
136139
top: var(--toastBarTop, auto);
137140
right: var(--toastBarRight, auto);

0 commit comments

Comments
 (0)