|
2 | 2 | @use '../../styles/lengths.scss';
|
3 | 3 | @use '../../styles/typography.scss';
|
4 | 4 |
|
| 5 | +$toastbar-color: theme('toastbar-color', colors.font(default)); |
| 6 | + |
| 7 | +$toastbar-border-radius: theme( |
| 8 | + 'toastbar-border-radius', |
| 9 | + lengths.border-radius(medium) |
| 10 | +); |
| 11 | + |
| 12 | +$toastbar-success-color: theme( |
| 13 | + 'toastbar-success-color', |
| 14 | + colors.status-font(on-success) |
| 15 | +); |
| 16 | + |
| 17 | +$toastbar-error-color: theme( |
| 18 | + 'toastbar-error-color', |
| 19 | + colors.status-font(on-danger) |
| 20 | +); |
| 21 | + |
| 22 | +$toastbar-background-color: theme( |
| 23 | + 'toastbar-background-color', |
| 24 | + colors.surface(tint) |
| 25 | +); |
| 26 | + |
| 27 | +$toastbar-progressbar-background-color: theme( |
| 28 | + 'toastbar-progressbar-background-color', |
| 29 | + colors.surface(neutral) |
| 30 | +); |
| 31 | + |
5 | 32 | .rcx-toastbar {
|
6 | 33 | position: relative;
|
7 | 34 |
|
8 | 35 | min-width: lengths.size(232);
|
9 | 36 | max-width: lengths.size(416);
|
10 | 37 |
|
11 |
| - border-radius: theme('toastbar-border-radius', lengths.border-radius(medium)); |
| 38 | + color: $toastbar-color; |
| 39 | + |
| 40 | + border-radius: $toastbar-border-radius; |
| 41 | + |
| 42 | + background-color: $toastbar-background-color; |
12 | 43 |
|
13 | 44 | @include typography.use-font-scale(p2);
|
14 | 45 |
|
15 |
| - &--info { |
16 |
| - background-color: theme( |
17 |
| - 'toastbar-info-background-color', |
18 |
| - colors.surface(neutral) |
19 |
| - ); |
| 46 | + &::before { |
| 47 | + position: absolute; |
| 48 | + top: 0; |
| 49 | + |
| 50 | + display: block; |
| 51 | + |
| 52 | + width: 100%; |
| 53 | + height: lengths.size(4); |
| 54 | + |
| 55 | + content: ''; |
| 56 | + |
| 57 | + border-radius: $toastbar-border-radius $toastbar-border-radius 0 0; |
| 58 | + background-color: transparent; |
20 | 59 | }
|
21 | 60 |
|
22 | 61 | &--success {
|
23 |
| - color: theme('toastbar-success-color', colors.status-font(on-success)); |
24 |
| - background-color: theme( |
25 |
| - 'toastbar-success-background-color', |
26 |
| - colors.status-background(success) |
27 |
| - ); |
| 62 | + &::before { |
| 63 | + background-color: $toastbar-success-color; |
| 64 | + } |
28 | 65 | }
|
29 | 66 |
|
30 | 67 | &--error {
|
31 |
| - color: theme('toastbar-error-color', colors.font(danger)); |
32 |
| - background-color: theme( |
33 |
| - 'toastbar-error-background-color', |
34 |
| - colors.status-background(danger) |
35 |
| - ); |
| 68 | + &::before { |
| 69 | + background-color: $toastbar-error-color; |
| 70 | + } |
36 | 71 | }
|
37 |
| -} |
38 | 72 |
|
39 |
| -.rcx-toastbar-inner { |
40 |
| - display: flex; |
| 73 | + &_inner { |
| 74 | + display: flex; |
41 | 75 |
|
42 |
| - padding: lengths.padding(16); |
43 |
| -} |
| 76 | + padding: lengths.padding(16); |
| 77 | + } |
44 | 78 |
|
45 |
| -.rcx-toastbar-content { |
46 |
| - width: lengths.size(full); |
47 |
| - margin: lengths.margin(0) lengths.margin(16); |
48 |
| -} |
| 79 | + &_content { |
| 80 | + width: lengths.size(full); |
| 81 | + margin: lengths.margin(0) lengths.margin(16); |
| 82 | + } |
49 | 83 |
|
50 |
| -$toastbar-border-radius: theme( |
51 |
| - 'toastbar-progressbar-border-radius', |
52 |
| - lengths.border-radius(medium) |
53 |
| -); |
| 84 | + &_icon { |
| 85 | + &--success { |
| 86 | + color: $toastbar-success-color; |
| 87 | + } |
54 | 88 |
|
55 |
| -.rcx-toastbar-progressbar { |
56 |
| - position: absolute; |
57 |
| - bottom: 0; |
| 89 | + &--error { |
| 90 | + color: $toastbar-error-color; |
| 91 | + } |
| 92 | + } |
58 | 93 |
|
59 |
| - overflow: hidden; |
| 94 | + &_progressbar { |
| 95 | + position: absolute; |
| 96 | + bottom: 0; |
60 | 97 |
|
61 |
| - width: 100%; |
62 |
| - height: lengths.size(4); |
| 98 | + overflow: hidden; |
63 | 99 |
|
64 |
| - border-radius: 0 0 $toastbar-border-radius $toastbar-border-radius; |
| 100 | + width: 100%; |
| 101 | + height: lengths.size(4); |
65 | 102 |
|
66 |
| - &::after { |
67 |
| - display: block; |
| 103 | + border-radius: 0 0 $toastbar-border-radius $toastbar-border-radius; |
68 | 104 |
|
69 |
| - height: 100%; |
| 105 | + &::after { |
| 106 | + display: block; |
70 | 107 |
|
71 |
| - content: ''; |
| 108 | + height: 100%; |
| 109 | + |
| 110 | + content: ''; |
72 | 111 |
|
73 |
| - background-color: colors.surface-neutral-alpha(10); |
| 112 | + background-color: $toastbar-progressbar-background-color; |
| 113 | + } |
74 | 114 | }
|
75 | 115 | }
|
0 commit comments