|
3 | 3 | @use './option/optgroup-theme';
|
4 | 4 | @use './elevation';
|
5 | 5 |
|
| 6 | +@mixin color($config-or-theme) { |
| 7 | + $config: theming.get-color-config($config-or-theme); |
| 8 | + |
| 9 | + @include option-theme.color($config-or-theme); |
| 10 | + @include optgroup-theme.color($config-or-theme); |
| 11 | + |
| 12 | + @if $config != null { |
| 13 | + // Provides external CSS classes for each elevation value. Each CSS class is formatted as |
| 14 | + // `mat-mdc-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the |
| 15 | + // element is elevated. |
| 16 | + @for $zValue from 0 through 24 { |
| 17 | + $selector: elevation.$prefix + $zValue; |
| 18 | + // We need the `mat-mdc-elevation-specific`, because some MDC mixins |
| 19 | + // come with elevation baked in and we don't have a way of removing it. |
| 20 | + .#{$selector}, .mat-mdc-elevation-specific.#{$selector} { |
| 21 | + @include elevation.private-theme-elevation($zValue, $config); |
| 22 | + } |
| 23 | + } |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +@mixin typography($config-or-theme) { |
| 28 | + @include option-theme.typography($config-or-theme); |
| 29 | + @include optgroup-theme.typography($config-or-theme); |
| 30 | +} |
| 31 | + |
| 32 | +@mixin density($config-or-theme) { |
| 33 | + @include option-theme.density($config-or-theme); |
| 34 | + @include optgroup-theme.density($config-or-theme); |
| 35 | +} |
| 36 | + |
6 | 37 | // Mixin that renders all of the core styles that depend on the theme.
|
7 | 38 | @mixin theme($theme-or-color-config) {
|
8 | 39 | $theme: theming.private-legacy-get-theme($theme-or-color-config);
|
|
12 | 43 | // the imported themes (such as `mat-ripple-theme`) should not report again.
|
13 | 44 | @include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-core') {
|
14 | 45 | $color: theming.get-color-config($theme);
|
15 |
| - |
16 |
| - @include option-theme.theme($theme); |
17 |
| - @include optgroup-theme.theme($theme); |
| 46 | + $density: theming.get-density-config($theme); |
| 47 | + $typography: theming.get-typography-config($theme); |
18 | 48 |
|
19 | 49 | @if $color != null {
|
20 |
| - // Provides external CSS classes for each elevation value. Each CSS class is formatted as |
21 |
| - // `mat-mdc-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the |
22 |
| - // element is elevated. |
23 |
| - @for $zValue from 0 through 24 { |
24 |
| - $selector: elevation.$prefix + $zValue; |
25 |
| - // We need the `mat-mdc-elevation-specific`, because some MDC mixins |
26 |
| - // come with elevation baked in and we don't have a way of removing it. |
27 |
| - .#{$selector}, .mat-mdc-elevation-specific.#{$selector} { |
28 |
| - @include elevation.private-theme-elevation($zValue, $color); |
29 |
| - } |
30 |
| - } |
| 50 | + @include color($color); |
| 51 | + } |
| 52 | + @if $density != null { |
| 53 | + @include density($density); |
| 54 | + } |
| 55 | + @if $typography != null { |
| 56 | + @include typography($typography); |
31 | 57 | }
|
32 | 58 | }
|
33 | 59 | }
|
0 commit comments