|
46 | 46 | } |
47 | 47 |
|
48 | 48 | $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 | + } |
50 | 57 |
|
51 | 58 | @if not($shadow) { |
52 | 59 | $elevation: map.get($toast-schema, 'elevation'); |
53 | 60 | $shadow: elevation($elevation); |
54 | 61 | } |
55 | 62 |
|
56 | | - @if not($text-color) and $background { |
57 | | - $text-color: text-contrast($background); |
58 | | - } |
59 | | - |
60 | 63 | @return extend($theme, ( |
61 | 64 | name: $name, |
62 | 65 | background: $background, |
63 | 66 | border-radius: $border-radius, |
64 | 67 | text-color: $text-color, |
65 | 68 | border-color: $border-color, |
66 | 69 | shadow: $shadow, |
67 | | - theme: map.get($schema, '_meta', 'theme'), |
68 | | - _meta: map.merge(if($meta, $meta, ()), ( |
69 | | - variant: map.get($schema, '_meta', 'theme') |
70 | | - )), |
71 | 70 | )); |
72 | 71 | } |
73 | 72 |
|
|
77 | 76 | /// @param {Map} $theme - The theme used to style the component. |
78 | 77 | @mixin toast($theme) { |
79 | 78 | @include css-vars($theme); |
80 | | - $variant: map.get($theme, '_meta', 'variant'); |
81 | 79 |
|
| 80 | + $variant: map.get($theme, '_meta', 'theme'); |
82 | 81 | $width: rem(52px); |
83 | 82 | $margin: rem(42px) auto; |
84 | 83 |
|
|
0 commit comments