schematic(theme): migrate project from prebuilt to custom theme #16416
Labels
area: ng-generate
Schematics that generate code in user projects
feature
This issue represents a new feature or feature request rather than a bug or bug fix
P4
A relatively minor issue that is not relevant to core functions
Projects
Feature Description
This actually came in through the Angular CLI feedback survey, but there is interest in having a
ng generate
schematic for migrating an app using a prebuilt theme to the custom theme configuration thatng add
already supports.Use Case
Many times at
ng add
time, users don't know why they would need a custom theme or don't know that they will need one. There are a number of gotchas and ways to get implementing a custom theme wrong. Having a schematic for this would help streamline that experience and fits well without our goals for Angular Material schematics.It's likely that a good deal of our existing
ng add
logic for adding a custom theme could be re-used. It looks like theng add
logic already handles things like adding a custom theme to a project that only uses CSS (it adds acustom-theme.scss
file and then adds that to thestyles
array in theangular.json
).There may be a need to allow the caller to point to the files where they import their prebuilt theme, as they may have moved it out of
src/styles.scss
. But maybe it's possible to walk the imports to find it?Proposal
ng g @angular/material:customTheme
The text was updated successfully, but these errors were encountered: