File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,8 @@ const defaults = {
158
158
progress: 0 , // current progress
159
159
reversed: false , // insert new toast to bottom of stack
160
160
intro: { x: 256 }, // toast intro fly animation settings
161
- theme: {} // css var overrides
161
+ theme: {}, // css var overrides
162
+ title: null // insert a title for the toast (optional)
162
163
}
163
164
```
164
165
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ const defaults = {
12
12
progress: 0 ,
13
13
reversed: false ,
14
14
intro: { x: 256 },
15
- theme: {}
15
+ theme: {},
16
+ title: null
16
17
}
17
18
toast ._opts (defaults)
18
19
$: toast ._opts (options)
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ $: if (prevProgress !== item.progress) {
35
35
will-change : transform,opacity;
36
36
-webkit-tap-highlight-color : transparent ;
37
37
}
38
+ ._toastTitle {
39
+ font-weight : bold ;
40
+ }
38
41
._toastMsg {
39
42
font : var (--toastFont );
40
43
flex : 1 1 0% ;
@@ -75,7 +78,12 @@ $: if (prevProgress !== item.progress) {
75
78
</style >
76
79
77
80
<div class =" _toastItem" >
78
- <div class ="_toastMsg" >{item .msg }</div >
81
+ <div class =" _toastMsg" >
82
+ {#if item .title }
83
+ <div class ="_toastTitle" >{item .title }</div >
84
+ {/if }
85
+ {item .msg }
86
+ </div >
79
87
80
88
{#if item .dismissable }
81
89
<div class ="_toastBtn" role ="button" tabindex ="-1" on:click ={() => toast .pop (item .id )}>✕</div >
You can’t perform that action at this time.
0 commit comments