1 | @use 'sass:map';
|
2 | @use 'theming/theming';
|
3 | @use './style/private';
|
4 | @use './ripple/ripple-theme';
|
5 | @use './option/option-theme';
|
6 | @use './option/optgroup-theme';
|
7 | @use './selection/pseudo-checkbox/pseudo-checkbox-theme';
|
8 | @use './style/elevation';
|
9 | @use './typography/typography';
|
10 |
|
11 | @mixin color($config-or-theme) {
|
12 | $config: theming.get-color-config($config-or-theme);
|
13 |
|
14 | @include ripple-theme.color($config);
|
15 | @include option-theme.color($config);
|
16 | @include optgroup-theme.color($config);
|
17 | @include pseudo-checkbox-theme.color($config);
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | .mat-app-background#{if(&, ', &.mat-app-background', '')} {
|
23 | $background: map.get($config, background);
|
24 | $foreground: map.get($config, foreground);
|
25 |
|
26 | background-color: theming.get-color-from-palette($background, background);
|
27 | color: theming.get-color-from-palette($foreground, text);
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | @for $zValue from 0 through 24 {
|
34 | $selector: elevation.$prefix + $zValue;
|
35 |
|
36 |
|
37 | .#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
|
38 | @include private.private-theme-elevation($zValue, $config);
|
39 | }
|
40 | }
|
41 |
|
42 |
|
43 | @at-root {
|
44 | .mat-theme-loaded-marker {
|
45 | display: none;
|
46 | }
|
47 | }
|
48 | }
|
49 |
|
50 | @mixin typography($config-or-theme) {
|
51 | $config: typography.private-typography-to-2018-config(
|
52 | theming.get-typography-config($config-or-theme));
|
53 |
|
54 | @include option-theme.typography($config);
|
55 | @include optgroup-theme.typography($config);
|
56 | @include pseudo-checkbox-theme.typography($config);
|
57 |
|
58 |
|
59 | }
|
60 |
|
61 | @mixin density($config-or-theme) {
|
62 | $density-scale: theming.get-density-config($config-or-theme);
|
63 |
|
64 | @include option-theme.density($density-scale);
|
65 | @include optgroup-theme.density($density-scale);
|
66 |
|
67 |
|
68 |
|
69 | }
|
70 |
|
71 |
|
72 | @mixin theme($theme-or-color-config) {
|
73 | $theme: theming.private-legacy-get-theme($theme-or-color-config);
|
74 |
|
75 |
|
76 |
|
77 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
|
78 | $color: theming.get-color-config($theme);
|
79 | $density: theming.get-density-config($theme);
|
80 | $typography: theming.get-typography-config($theme);
|
81 |
|
82 | @if $color != null {
|
83 | @include color($color);
|
84 | }
|
85 | @if $density != null {
|
86 | @include density($density);
|
87 | }
|
88 | @if $typography != null {
|
89 | @include typography($typography);
|
90 | }
|
91 | }
|
92 | }
|