-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(M3): theme not being applied on mat-menu and mat-option #29367
Comments
The issue is apparent when the project has two themes. Suppose that the light theme is applied in |
What element are you applying the theme classes to? I suspect that it isn't being set on the |
I am applying the themes on all of the components as am using the following commands:
As for using |
Because the menu popup is in a CDK overlay, it is attached directly to the |
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I have the following working theme switcher code:
All of the
mat-...
work by default exceptmat-menu
andmat-option
.I create a custom mixin to manually update the colour of
mat-menu
but it only works for the light theme because it is placed in:root{ }
. Otherwise, it will not be triggered. All of the packages are up to date and no errors occur. The html code used is:Reproduction
There is no StackBlitz link because the link of the documentation doesn't work with Angular 18.0.6.
Expected Behavior
The expected behaviour is to have both
mat-menu
andmat-option
to follow automatically the theme, without the need of custom mixins.Actual Behavior
The
mat-menu
is updated once because the mixin call was placed in:root{}
, andmat-option
just doesn't work.Environment
Angular CLI: 18.0.6
Node: 20.14.0
Package Manager: npm 10.8.1
OS: darwin arm64
Angular: 18.0.5
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1800.6
@angular-devkit/build-angular 18.0.6
@angular-devkit/core 18.0.6
@angular-devkit/schematics 18.0.6
@angular/cli 18.0.6
@schematics/angular 18.0.6
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.7
The text was updated successfully, but these errors were encountered: