-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Can't assign custom class for mat-tab #15997
Comments
You can provide your own custom content for the tab label but I agree there is no great way to style the entire label (not just text). https://stackblitz.com/edit/angular-material2-issue-epfe1y?file=app/app.component.ts |
Duplicate of #9290 |
We can tweak with
<mat-tab>
<ng-template mat-tab-label>
<span class="deleteTab">Delete Tab</span>
</ng-template>
...
</mat-tab>
.deleteTab {
color: red;
} |
So, the Update: works in 13.2.0, great! |
Yeah having a way to define classes for the automatically generated components would be very useful. Currently there is no way to differentiate between the different |
labelClass and bodyClass are still broken. They don't conform to the docs, nor do they seem to do anything. |
It seems that the corresponding style definition for the Here is a working example I made from the v14 docs, but it works for v17 too |
What is the expected behavior?
[ngClass] used on mat-tab should add class on "mat-tab-label" div
What is the current behavior?
There is no way to add custom class to "mat-tab-label" div
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-xq3ql9
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
7.3.7
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: