|
15 | 15 | @include helper.root($default-background);
|
16 | 16 | }
|
17 | 17 |
|
18 |
| -@mixin init-mat-theme($dark-theme-selector, $typography-config: mat.define-typography-config(), $load-mdc-components, $load-legacy-components) { |
19 |
| - @if $load-mdc-components { |
20 |
| - @include mat.core(); |
21 |
| - } |
22 |
| - @if $load-legacy-components { |
23 |
| - @include mat.legacy-core(); |
24 |
| - } |
| 18 | +@mixin init-mat-theme($dark-theme-selector, $typography-config: mat.define-typography-config()) { |
| 19 | + @include mat.core(); |
25 | 20 |
|
26 | 21 | $primary: mat.define-palette(variables.$palette-primary);
|
27 | 22 | $accent: mat.define-palette(variables.$palette-accent);
|
|
57 | 52 | $mat-css-theme: $theme !global; // stays for backwards-compatibility
|
58 | 53 |
|
59 | 54 | // NOTE: light theme is the default theme
|
60 |
| - @if $load-mdc-components { |
61 |
| - @include mat.all-component-themes($theme); |
62 |
| - } |
63 |
| - @if $load-legacy-components { |
64 |
| - @include mat.all-legacy-component-themes($theme); |
65 |
| - } |
| 55 | + @include mat.all-component-themes($theme); |
66 | 56 |
|
67 | 57 | // Fix mat-typography class, see https://github.com/angular/components/issues/26184
|
68 | 58 | @include mat.typography-hierarchy($theme);
|
|
72 | 62 | @if $dark-theme-selector {
|
73 | 63 | $mat-css-theme: $dark-theme !global;
|
74 | 64 | #{$dark-theme-selector} {
|
75 |
| - @if $load-mdc-components { |
76 |
| - @include mat.all-component-colors($dark-theme); |
77 |
| - } |
78 |
| - @if $load-legacy-components { |
79 |
| - @include mat.all-legacy-component-colors($dark-theme); |
80 |
| - } |
| 65 | + @include mat.all-component-colors($dark-theme); |
81 | 66 | // add content passed in, which can use the $theme variable to apply the dark theme to
|
82 | 67 | // other theme mixins needed by the app
|
83 | 68 | @content($mat-css-theme);
|
|
96 | 81 | $typography-config: mat.define-typography-config(),
|
97 | 82 | $default-foreground: variables.$default-foreground,
|
98 | 83 | $default-background: variables.$default-background,
|
99 |
| - $load-mdc-components: true, |
100 |
| - $load-legacy-components: false, |
101 | 84 | ) {
|
102 | 85 | @include init-css-vars($default-theme, $default-theme-text, $default-foreground, $default-background);
|
103 |
| - @include init-mat-theme($dark-theme-selector, $typography-config, $load-mdc-components, $load-legacy-components) using ($mat-css-theme) { |
| 86 | + @include init-mat-theme($dark-theme-selector, $typography-config) using ($mat-css-theme) { |
104 | 87 | @content($mat-css-theme);
|
105 | 88 | }
|
106 | 89 | }
|
0 commit comments