File tree Expand file tree Collapse file tree 1 file changed +22
-14
lines changed Expand file tree Collapse file tree 1 file changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -156,31 +156,39 @@ Toast messages can be in rich HTML too - for example:
156
156
157
157
``` js
158
158
// Definitely not spam
159
- toast .push (' <strong>You won the jackpot!</strong><br>Click <a href="#" target="_blank">here</a> for details! 😛' )
159
+ toast .push (` <strong>You won the jackpot!</strong><br>
160
+ Click <a href="#" target="_blank">here</a> for details! 😛` )
160
161
```
161
162
162
163
### Custom Fonts
163
164
164
- Apply custom font CSS on toast messages by setting styles globally on the ` ._toastMsg ` class:
165
+ In a Svelte app, the easiest way to apply custom font styles is to wrap the toast container
166
+ then apply styles on the wrapper:
165
167
166
168
``` html
167
169
<style >
168
- /* In Svelte app, use the `:global` modifier */
169
- :global(._toastMsg ) {
170
- font-family : Roboto, sans-serif ;
171
- font-size : 0.875rem ;
172
- font-weight : 300 ;
173
- line-height : 1.125 ;
174
- }
175
- :global(._toastMsg > strong ) {
176
- font-weight : 600 ;
177
- }
170
+ .wrap {
171
+ font-family : Roboto, sans-serif ;
172
+ font-size : 0.875rem ;
173
+ ...
174
+ }
175
+ .wrap :global(strong ) {
176
+ font-weight : 600 ;
177
+ }
178
+ </style >
178
179
179
- /* For any others, just apply globally */
180
+ <div class =" wrap" >
181
+ <SvelteToast />
182
+ </div >
183
+ ```
184
+
185
+ In Vanilla JS, simply apply your styles to the ` ._toastMsg ` class:
186
+
187
+ ``` css
180
188
._toastMsg {
189
+ font-family : Roboto, sans-serif ;
181
190
...
182
191
}
183
- </style >
184
192
```
185
193
186
194
## Options
You can’t perform that action at this time.
0 commit comments