|
79 | 79 | <div |
80 | 80 | data-tid="toast-component" |
81 | 81 | role="dialog" |
82 | | - class={`toast ${theme ?? "themed"}`} |
| 82 | + class={`toast ${level} ${theme ?? "themed"}`} |
83 | 83 | in:fly|global={{ y: (position === "top" ? -1 : 1) * 100, duration: 200 }} |
84 | 84 | out:fade|global={{ delay: 100 }} |
85 | 85 | > |
|
140 | 140 | padding: var(--padding-1_5x); |
141 | 141 | box-sizing: border-box; |
142 | 142 |
|
| 143 | + background: var(--toast-background, var(--overlay-background)); |
| 144 | + color: var(--toast-color, var(--overlay-background-contrast)); |
| 145 | +
|
| 146 | + &.success { |
| 147 | + --toast-background: var(--toast-success-background); |
| 148 | + --toast-color: var(--toast-success-color); |
| 149 | + } |
| 150 | +
|
| 151 | + &.info { |
| 152 | + --toast-background: var(--toast-info-background); |
| 153 | + --toast-color: var(--toast-info-color); |
| 154 | + } |
| 155 | +
|
| 156 | + &.warn { |
| 157 | + --toast-background: var(--toast-warn-background); |
| 158 | + --toast-color: var(--toast-warn-color); |
| 159 | + } |
| 160 | +
|
| 161 | + &.error { |
| 162 | + --toast-background: var(--toast-error-background); |
| 163 | + --toast-color: var(--toast-error-color); |
| 164 | + } |
| 165 | +
|
143 | 166 | &.inverted { |
144 | 167 | @include overlay.toast-inverted; |
| 168 | +
|
| 169 | + --toast-background: var(--toast-inverted-background); |
| 170 | + --toast-color: var(--toast-inverted-background-contrast); |
| 171 | +
|
| 172 | + &.success { |
| 173 | + --toast-background: var(--toast-success-inverted-background); |
| 174 | + --toast-color: var(--toast-success-inverted-color); |
| 175 | + } |
| 176 | +
|
| 177 | + &.info { |
| 178 | + --toast-background: var(--toast-info-inverted-background); |
| 179 | + --toast-color: var(--toast-info-inverted-color); |
| 180 | + } |
| 181 | +
|
| 182 | + &.warn { |
| 183 | + --toast-background: var(--toast-warn-inverted-background); |
| 184 | + --toast-color: var(--toast-warn-inverted-color); |
| 185 | + } |
| 186 | +
|
| 187 | + &.error { |
| 188 | + --toast-background: var(--toast-error-inverted-background); |
| 189 | + --toast-color: var(--toast-error-inverted-color); |
| 190 | + } |
145 | 191 | } |
146 | 192 |
|
147 | 193 | .icon { |
|
0 commit comments