Is there a way to style Angular Material Tabs locally?

161 Views Asked by At

I am trying to style a mat-tab locally,

I understand that :ng-deep affects the style to be global,

But is there a way to change style per component?

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

it is possible to apply styles to only one mat-table component. i handled this by wrapping the styles which i want to apply inside the selector of the component. so inside your root styles.scss you can do something like this.

// styles.scss
parent-component-selector {
  mat-table {
    background-color: black;
  }
}

this will apply the styles only when the mat-table is inside the parent-component selector.