Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/material/schematics/ng-add/theming/theming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ const defaultCustomThemeFilename = 'custom-theme.scss';
/** Add pre-built styles to the main project style file. */
export function addThemeToAppStyles(options: Schema): Rule {
return (host: Tree, context: SchematicContext) => {
const palettes = options.theme || 'azure-blue';
let palettes = options.theme || 'azure-blue';

// For a long time, theme param could be "custom" which meant to add a custom theme. This option
// was removed since we always add a custom theme, and we expect this option to be the
// user's preferred palettes. However it's possible that users will have hardcoded CLI commands
// that pass "--theme custom" and we can gracefully handle this by assuming azure-blue.
if (palettes === 'custom') {
palettes = 'azure-blue';
}

return insertCustomTheme(palettes, options.project, host, context.logger);
};
}
Expand Down
Loading