1 | @use 'sass:map';
|
---|
2 | @use '../core/theming/theming';
|
---|
3 |
|
---|
4 | @mixin color($config-or-theme) {
|
---|
5 | $config: theming.get-color-config($config-or-theme);
|
---|
6 | $primary: map.get($config, primary);
|
---|
7 | $accent: map.get($config, accent);
|
---|
8 | $warn: map.get($config, warn);
|
---|
9 | $background: map.get($config, background);
|
---|
10 | $foreground: map.get($config, foreground);
|
---|
11 |
|
---|
12 | .mat-icon {
|
---|
13 | &.mat-primary {
|
---|
14 | color: theming.get-color-from-palette($primary, text);
|
---|
15 | }
|
---|
16 |
|
---|
17 | &.mat-accent {
|
---|
18 | color: theming.get-color-from-palette($accent, text);
|
---|
19 | }
|
---|
20 |
|
---|
21 | &.mat-warn {
|
---|
22 | color: theming.get-color-from-palette($warn, text);
|
---|
23 | }
|
---|
24 | }
|
---|
25 | }
|
---|
26 |
|
---|
27 | @mixin typography($config-or-theme) {}
|
---|
28 |
|
---|
29 | @mixin _density($config-or-theme) {}
|
---|
30 |
|
---|
31 | @mixin theme($theme-or-color-config) {
|
---|
32 | $theme: theming.private-legacy-get-theme($theme-or-color-config);
|
---|
33 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon') {
|
---|
34 | $color: theming.get-color-config($theme);
|
---|
35 | $density: theming.get-density-config($theme);
|
---|
36 | $typography: theming.get-typography-config($theme);
|
---|
37 |
|
---|
38 | @if $color != null {
|
---|
39 | @include color($color);
|
---|
40 | }
|
---|
41 | @if $density != null {
|
---|
42 | @include _density($density);
|
---|
43 | }
|
---|
44 | @if $typography != null {
|
---|
45 | @include typography($typography);
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|