I'm facing a challenge with styling components that use mat-tab elements in my HTML. Currently, I can only style them using ::ng-deep .mat-tab-label {}
and adding !important
to at least one of the styles. However, I don't want to rely on this solution long-term, especially after reading this article.
Upon inspecting the elements in the developer tools, here's how they are structured:
<mat-card class="mat-card">
<mat-tab-group class="mat-tab-group mat-primary">
<mat-tab-header class="mat-tab-header">
<div class="mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4 mat-ripple mat-tab-header-pagination-disabled>
<div class="mat-tab-label-container">
<div class="mat-tab-list">
<div class="mat-tab-labels">
<div class="mat-tab-label mat-ripple mat-tab-label-active ng-star-inserted">
<mat-ink-bar class="mat-ink-bar">
Is there an alternative method I can use to style these elements in CSS without resorting to ::ng-deep
and !important
?