Skip to content

Commit d95e8d6

Browse files
committed
feat(material/schematics): add migration to switch to the new theming API
Adds an `ng-generate` schematic that will switch over existing stylesheets to the new `@use`-based API. Furthermore, the migration code is set up in a way that should allow us to run it in g3 if necessary.
1 parent 3c975e9 commit d95e8d6

File tree

7 files changed

+843
-2
lines changed

7 files changed

+843
-2
lines changed

src/cdk/_index.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
@forward './overlay/overlay' show overlay;
1+
@forward './overlay/overlay' show overlay, $z-index-overlay-container, $z-index-overlay,
2+
$z-index-overlay-backdrop, $dark-backdrop-background;
23
@forward './a11y/a11y' show a11y-visually-hidden, high-contrast;
34
@forward './text-field/text-field' show text-field-autosize, text-field-autofill,
4-
text-field-autofill-color;
5+
text-field-autofill-color,
6+
// `text-field` is deprecated, but we have to export it
7+
// here in order for the theming API schematic to work.
8+
text-field;

src/material/schematics/collection.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
"factory": "./ng-generate/address-form/index",
4343
"schema": "./ng-generate/address-form/schema.json",
4444
"aliases": ["address-form", "material-address-form", "material-addressForm"]
45+
},
46+
"themingApi": {
47+
"description": "Switch the project to the new @use-based Material theming API",
48+
"factory": "./ng-generate/theming-api/index",
49+
"schema": "./ng-generate/theming-api/schema.json",
50+
"aliases": ["theming-api", "sass-api"]
4551
}
4652
}
4753
}

0 commit comments

Comments
 (0)