File tree Expand file tree Collapse file tree 4 files changed +85
-0
lines changed Expand file tree Collapse file tree 4 files changed +85
-0
lines changed Original file line number Diff line number Diff line change
1
+ // See https://github.com/material-components/material-components-web/blob/v13.0.0/packages/mdc-snackbar/
2
+ @use ' @material/snackbar/mixins' ;
3
+ // See https://github.com/material-components/material-components-web/blob/v13.0.0/packages/mdc-theme/
4
+ @use ' @material/theme/color-palette' ;
5
+ @use ' @material/theme/theme-color' ;
6
+
7
+ .mdc-snackbar.demo-success {
8
+ @include mixins .fill-color (color-palette .$green-500 );
9
+ @include mixins .label-ink-color (
10
+ theme-color .accessible-ink-color (color-palette .$green-500 )
11
+ );
12
+ }
13
+
14
+ .mdc-snackbar.demo-warning {
15
+ @include mixins .fill-color (color-palette .$orange-500 );
16
+ @include mixins .label-ink-color (
17
+ theme-color .accessible-ink-color (color-palette .$orange-500 )
18
+ );
19
+ }
20
+
21
+ .mdc-snackbar.demo-error {
22
+ @include mixins .fill-color (color-palette .$red-500 );
23
+ @include mixins .label-ink-color (
24
+ theme-color .accessible-ink-color (color-palette .$red-500 )
25
+ );
26
+ }
Original file line number Diff line number Diff line change
1
+ <Snackbar bind:this ={snackbarSuccess } class =" demo-success" >
2
+ <Label
3
+ >That thing you tried to do actually worked, if you can believe it!</Label
4
+ >
5
+ <Actions >
6
+ <IconButton class =" material-icons" title =" Dismiss" >close</IconButton >
7
+ </Actions >
8
+ </Snackbar >
9
+
10
+ <Snackbar bind:this ={snackbarWarning } class =" demo-warning" >
11
+ <Label
12
+ >Ok, it looks like that thing you tried to do might not have work.</Label
13
+ >
14
+ <Actions >
15
+ <IconButton class =" material-icons" title =" Dismiss" >close</IconButton >
16
+ </Actions >
17
+ </Snackbar >
18
+
19
+ <Snackbar bind:this ={snackbarError } class =" demo-error" >
20
+ <Label
21
+ >That thing you tried to do didn't work. Honestly, I'm not sure why you even
22
+ tried.</Label
23
+ >
24
+ <Actions >
25
+ <IconButton class =" material-icons" title =" Dismiss" >close</IconButton >
26
+ </Actions >
27
+ </Snackbar >
28
+
29
+ <Button on:click ={() => snackbarSuccess && snackbarSuccess .open ()}>
30
+ <Label >Open Success Snackbar</Label >
31
+ </Button >
32
+
33
+ <Button on:click ={() => snackbarWarning && snackbarWarning .open ()}>
34
+ <Label >Open Warning Snackbar</Label >
35
+ </Button >
36
+
37
+ <Button on:click ={() => snackbarError && snackbarError .open ()}>
38
+ <Label >Open Error Snackbar</Label >
39
+ </Button >
40
+
41
+ <script lang =" ts" >
42
+ import type { SnackbarComponentDev } from ' @smui/snackbar' ;
43
+ import Snackbar , { Label , Actions } from ' @smui/snackbar' ;
44
+ import IconButton from ' @smui/icon-button' ;
45
+ import Button from ' @smui/button' ;
46
+
47
+ let snackbarSuccess: SnackbarComponentDev ;
48
+ let snackbarWarning: SnackbarComponentDev ;
49
+ let snackbarError: SnackbarComponentDev ;
50
+ </script >
Original file line number Diff line number Diff line change 25
25
Using dynamic text
26
26
</Demo >
27
27
28
+ <Demo
29
+ component ={Colors }
30
+ files ={[' snackbar/_Colors.svelte' , ' snackbar/_Colors.scss' ]}
31
+ >
32
+ Colored snackbars
33
+ </Demo >
34
+
28
35
<Demo component ={Kitchen } file =" snackbar/_Kitchen.svelte" >
29
36
The "Kitchen" Snackbar generator
30
37
</Demo >
37
44
import LeadingWithAction from ' ./_LeadingWithAction.svelte' ;
38
45
import StackedWithAction from ' ./_StackedWithAction.svelte' ;
39
46
import DynamicText from ' ./_DynamicText.svelte' ;
47
+ import Colors from ' ./_Colors.svelte' ;
40
48
import Kitchen from ' ./_Kitchen.svelte' ;
41
49
</script >
Original file line number Diff line number Diff line change 27
27
@use ' ./routes/demo/linear-progress/_Colored.scss' as linear-progress-colored ;
28
28
@use ' ./routes/demo/menu-surface/_ManualAnchor.scss' ;
29
29
@use ' ./routes/demo/paper/_CustomColor.scss' as paper-custom-color ;
30
+ @use ' ./routes/demo/snackbar/_Colors.scss' ;
30
31
@use ' ./routes/demo/typography/_Typography.scss' ;
You can’t perform that action at this time.
0 commit comments