Skip to content

bug(theme-color): Generator theme-color flags --force and --defaults do nothing #30578

@muuvmuuv

Description

@muuvmuuv

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

This is our theme-color generator command, running it twice results in "already exists" even with --force, also --defaults seem to have no effect here.

pnpm ng generate @angular/material:theme-color --force --defaults --directory="/libs/app-theme/vendor/material/" --primary-color="#0641e6" --tertiary-color="#994aff" --neutral-color="#313138" --error-color="#eb5757" --secondary-color="#009096" --neutral-variant-color="#b2b2b8"

Path "/libs/app-theme/vendor/material/_theme-colors.scss" already exist.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-waftjbtm?file=package.json
Steps to reproduce:

  1. npm run issue

Btw this starter is on NG18!

Expected Behavior

Should respect all flags, even default to avoid providing all color flags.

Actual Behavior

Some flags are ignored.

Environment

  • Angular: See repl
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):

Activity

crisbeto

crisbeto commented on Jun 23, 2025

@crisbeto
Member

I'm not sure where you saw the --force and --defaults flags, but they aren't mentioned in our docs. These are the available flags: https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/theme-color/schema.json

muuvmuuv

muuvmuuv commented on Jun 23, 2025

@muuvmuuv
Author

From the CLI --help. See my screenshot, I am on version 20.0.3

Image

crisbeto

crisbeto commented on Jun 23, 2025

@crisbeto
Member

Will transfer this into the CLI repo since these aren't flags we've configured.

added theissue type on Jun 23, 2025
added a commit that references this issue on Oct 21, 2025
90d3477
added a commit that references this issue on Oct 21, 2025
c58a2d1
added a commit that references this issue on Oct 21, 2025
a31533c
added a commit that references this issue on Oct 21, 2025
18bf8e7
angular-automatic-lock-bot

angular-automatic-lock-bot commented on Nov 21, 2025

@angular-automatic-lock-bot

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

locked and limited conversation to collaborators on Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @crisbeto@muuvmuuv@alan-agius4

      Issue actions

        bug(theme-color): Generator theme-color flags --force and --defaults do nothing · Issue #30578 · angular/angular-cli