|
1 | 1 | @use 'sass:map'; |
2 | | -@use 'theming/theming'; |
| 2 | +@use './theming/theming'; |
| 3 | +@use './theming/inspection'; |
3 | 4 | @use './style/private'; |
4 | 5 | @use './ripple/ripple-theme'; |
5 | 6 | @use './option/option-theme'; |
|
8 | 9 | @use './style/elevation'; |
9 | 10 | @use './typography/typography'; |
10 | 11 |
|
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); |
| 12 | +@mixin color($theme) { |
| 13 | + @include ripple-theme.color($theme); |
| 14 | + @include option-theme.color($theme); |
| 15 | + @include optgroup-theme.color($theme); |
| 16 | + @include pseudo-checkbox-theme.color($theme); |
18 | 17 |
|
19 | 18 | // Wrapper element that provides the theme background when the user's content isn't |
20 | 19 | // inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand |
21 | 20 | // selector in case the mixin is included at the top level. |
22 | 21 | .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); |
| 22 | + background-color: inspection.get-theme-color($theme, background, background); |
| 23 | + color: inspection.get-theme-color($theme, foreground, text); |
28 | 24 | } |
29 | 25 |
|
30 | 26 | // Provides external CSS classes for each elevation value. Each CSS class is formatted as |
|
35 | 31 | // We need the `mat-mdc-elevation-specific`, because some MDC mixins |
36 | 32 | // come with elevation baked in and we don't have a way of removing it. |
37 | 33 | .#{$selector}, .mat-mdc-elevation-specific.#{$selector} { |
38 | | - @include private.private-theme-elevation($zValue, $config); |
| 34 | + @include private.private-theme-elevation($zValue, $theme); |
39 | 35 | } |
40 | 36 | } |
41 | 37 |
|
|
75 | 71 | // there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then |
76 | 72 | // the imported themes (such as `mat-ripple-theme`) should not report again. |
77 | 73 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') { |
78 | | - $color: theming.get-color-config($theme); |
79 | 74 | $density: theming.get-density-config($theme); |
80 | 75 | $typography: theming.get-typography-config($theme); |
81 | 76 |
|
82 | | - @if $color != null { |
83 | | - @include color($color); |
| 77 | + @if inspection.theme-has($theme, color) { |
| 78 | + @include color($theme); |
84 | 79 | } |
85 | 80 | @if $density != null { |
86 | 81 | @include density($density); |
|
0 commit comments