1 | @use 'sass:map';
|
---|
2 | @use '../core/typography/typography';
|
---|
3 | @use '../core/typography/typography-utils';
|
---|
4 | @use '../core/theming/theming';
|
---|
5 | @use '../core/theming/palette';
|
---|
6 | @use '../core/style/private';
|
---|
7 |
|
---|
8 | @mixin color($config-or-theme) {
|
---|
9 | $config: theming.get-color-config($config-or-theme);
|
---|
10 | $is-dark-theme: map.get($config, is-dark);
|
---|
11 | $accent: map.get($config, accent);
|
---|
12 |
|
---|
13 | .mat-snack-bar-container {
|
---|
14 | // Use the primary text on the dark theme, even though the lighter one uses
|
---|
15 | // a secondary, because the contrast on the light primary text is poor.
|
---|
16 | color: if($is-dark-theme, palette.$dark-primary-text, palette.$light-secondary-text);
|
---|
17 | background: if($is-dark-theme, map.get(palette.$grey-palette, 50), #323232);
|
---|
18 |
|
---|
19 | @include private.private-theme-elevation(6, $config);
|
---|
20 | }
|
---|
21 |
|
---|
22 | .mat-simple-snackbar-action {
|
---|
23 | color: if($is-dark-theme, inherit, theming.get-color-from-palette($accent, text));
|
---|
24 | }
|
---|
25 | }
|
---|
26 |
|
---|
27 | @mixin typography($config-or-theme) {
|
---|
28 | $config: typography.private-typography-to-2014-config(
|
---|
29 | theming.get-typography-config($config-or-theme));
|
---|
30 | .mat-simple-snackbar {
|
---|
31 | font: {
|
---|
32 | family: typography-utils.font-family($config, body-1);
|
---|
33 | size: typography-utils.font-size($config, body-1);
|
---|
34 | }
|
---|
35 | }
|
---|
36 |
|
---|
37 | .mat-simple-snackbar-action {
|
---|
38 | line-height: 1;
|
---|
39 | font: {
|
---|
40 | family: inherit;
|
---|
41 | size: inherit;
|
---|
42 | weight: typography-utils.font-weight($config, button);
|
---|
43 | }
|
---|
44 | }
|
---|
45 | }
|
---|
46 |
|
---|
47 | @mixin _density($config-or-theme) {}
|
---|
48 |
|
---|
49 | @mixin theme($theme-or-color-config) {
|
---|
50 | $theme: theming.private-legacy-get-theme($theme-or-color-config);
|
---|
51 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') {
|
---|
52 | $color: theming.get-color-config($theme);
|
---|
53 | $density: theming.get-density-config($theme);
|
---|
54 | $typography: theming.get-typography-config($theme);
|
---|
55 |
|
---|
56 | @if $color != null {
|
---|
57 | @include color($color);
|
---|
58 | }
|
---|
59 | @if $density != null {
|
---|
60 | @include _density($density);
|
---|
61 | }
|
---|
62 | @if $typography != null {
|
---|
63 | @include typography($typography);
|
---|
64 | }
|
---|
65 | }
|
---|
66 | }
|
---|