From 5610daaa819b0290ac06556053fc20f7d85efd35 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Wed, 16 Jul 2025 15:24:35 -0600 Subject: [PATCH] fix(material/schematics): access custom as a theme palette --- src/material/schematics/ng-add/theming/theming.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/material/schematics/ng-add/theming/theming.ts b/src/material/schematics/ng-add/theming/theming.ts index ed9263dfd49a..7486d1b61114 100644 --- a/src/material/schematics/ng-add/theming/theming.ts +++ b/src/material/schematics/ng-add/theming/theming.ts @@ -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); }; }