Skip to content

Commit a357ce6

Browse files
authored
feat(toast): improve toast theme (#15713)
1 parent 96d7878 commit a357ce6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

projects/igniteui-angular/src/lib/core/styles/components/toast/_toast-theme.scss

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,27 @@
4646
}
4747

4848
$theme: digest-schema($toast-schema);
49-
$meta: map.get($theme, '_meta');
49+
50+
@if not($text-color) and $background {
51+
$text-color: adaptive-contrast(var(--background));
52+
}
53+
54+
@if not($border-color) and $text-color {
55+
$border-color: hsla(from var(--text-color) h s l / 0.3);
56+
}
5057

5158
@if not($shadow) {
5259
$elevation: map.get($toast-schema, 'elevation');
5360
$shadow: elevation($elevation);
5461
}
5562

56-
@if not($text-color) and $background {
57-
$text-color: text-contrast($background);
58-
}
59-
6063
@return extend($theme, (
6164
name: $name,
6265
background: $background,
6366
border-radius: $border-radius,
6467
text-color: $text-color,
6568
border-color: $border-color,
6669
shadow: $shadow,
67-
theme: map.get($schema, '_meta', 'theme'),
68-
_meta: map.merge(if($meta, $meta, ()), (
69-
variant: map.get($schema, '_meta', 'theme')
70-
)),
7170
));
7271
}
7372

@@ -77,8 +76,8 @@
7776
/// @param {Map} $theme - The theme used to style the component.
7877
@mixin toast($theme) {
7978
@include css-vars($theme);
80-
$variant: map.get($theme, '_meta', 'variant');
8179

80+
$variant: map.get($theme, '_meta', 'theme');
8281
$width: rem(52px);
8382
$margin: rem(42px) auto;
8483

0 commit comments

Comments
 (0)