Skip to content

Commit 708beeb

Browse files
committed
feat!: remove option to load legacy components
1 parent 3a9a57c commit 708beeb

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

projects/material-css-vars/src/lib/_main.scss

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515
@include helper.root($default-background);
1616
}
1717

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();
2520

2621
$primary: mat.define-palette(variables.$palette-primary);
2722
$accent: mat.define-palette(variables.$palette-accent);
@@ -57,12 +52,7 @@
5752
$mat-css-theme: $theme !global; // stays for backwards-compatibility
5853

5954
// 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);
6656

6757
// Fix mat-typography class, see https://github.com/angular/components/issues/26184
6858
@include mat.typography-hierarchy($theme);
@@ -72,12 +62,7 @@
7262
@if $dark-theme-selector {
7363
$mat-css-theme: $dark-theme !global;
7464
#{$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);
8166
// add content passed in, which can use the $theme variable to apply the dark theme to
8267
// other theme mixins needed by the app
8368
@content($mat-css-theme);
@@ -96,11 +81,9 @@
9681
$typography-config: mat.define-typography-config(),
9782
$default-foreground: variables.$default-foreground,
9883
$default-background: variables.$default-background,
99-
$load-mdc-components: true,
100-
$load-legacy-components: false,
10184
) {
10285
@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) {
10487
@content($mat-css-theme);
10588
}
10689
}

0 commit comments

Comments
 (0)