bug(MatTooltip): matTooltipClass not working with angular 16
Is this a regression?
- [X] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
14.2.11
Description
any modification with matTooltipClass, doesn't work
Reproduction
StackBlitz link: Steps to reproduce: 1. 2.
Expected Behavior
make custom changes
Actual Behavior
does not show any change
Environment
- Angular: 16.1.0
- CDK/Material: 16.1.0
- Browser(s): Google Chrome
- Operating System (Windows)
The class is being added, but the tooltip isn't what is being styled, it's a child element of the tooltip: You might want to target it specifically:
.mat-tooltip .mdc-tooltip__surface {
color: red;
}
https://stackblitz.com/edit/components-issue-jft2ro?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.css,src%2Fstyles.scss,src%2Fapp%2Fexample-component.ts
@wartab is correct, with the new implementation you need to target the styles at the .mdc-tooltip__surface child element
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.