-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team
Description
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
17
Description
Hello!
I'm trying to define a custom theme for a new project using Angular 18 following the theming guide. At first, I tried to select the custom theme option when I added the Angular Material to the project, so it created a generic theme using azure and blue palettes. When I insert a material button into the HTML, it is rendered with the primary color, but if I try to change its color to "accent" or "warn" with the color directive, nothing happens; it stays with the primary color.
Reproduction
I tried to create a project on StackBlitz but an error occurs when I add Angular Material...
Steps to reproduce:
- Create a new project using @angular/cli version 18 (for the style question, select "scss")
- Add @angular/material to the project (for the theme question, select "custom", it will create a generic theme using azure and blue palletes)
- Replace the content of app.component.html with a mat-flat-button using the color directive, as follows:
<button mat-flat-button color="primary">Button</button>
- Run the project (the button will appear with an azure color)
- Change the button color directive to "accent" or "warn"
- Reload the project (the button color will not change)
Expected Behavior
The color of the button must change when the color directive is changed.
Actual Behavior
The color of the button don't change despite the color directive.
Environment
- Angular: 18.0.1
- CDK/Material: 18.0.0
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
jemmalmohamed and lukasbuehler
Metadata
Metadata
Assignees
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team