Skip to content

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

Open
@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
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

      Development

      No branches or pull requests

        Participants

        @crisbeto@muuvmuuv@alan-agius4

        Issue actions

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