title: Dynamically style a mat-tab property from an Angular 6 component
body: <p>I have a <code>mat-tab-group</code> with two tabs -  Basic search and Advance Search. Since the advanced search has a lot more form fields, I'd like to dynamically modify the <code>max-height</code> property of the <code>.mat-tab-body-content</code> class.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;mat-tab-group (selectedTabChange)="tabChanged($event)"&gt;
   &lt;mat-tab label="Basic"&gt;
    &lt;ng-template matTabContent&gt;
     
  
    &lt;!-- .. --&gt;
  
    &lt;/ng-template&gt;
   &lt;/mat-tab&gt;
   &lt;mat-tab label="Advanced"&gt;
    &lt;div&gt;
     &lt;ng-template matTabContent #advSearchTab&gt;
      &lt;form [formGroup]="searchForm" (ngSubmit)="search()"  &gt;
      
       &lt;!-- ... --&gt;
       
      &lt;/form&gt;
     &lt;/ng-template&gt;
    &lt;/div&gt;
   &lt;/mat-tab&gt;
  &lt;/mat-tab-group&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And when it renders to the DOM, Angular injects this content class:</p>
  
  <pre><code>  &lt;div class="mat-tab-body-content ng-trigger ng-trigger-translateTab" style="transform: none;"&gt;
  </code></pre>
  
  <p>I have some scss which I would like to change dynamically in my component ts code.</p>
  
  <p>Here's the scss settings I have currently for the <code>max-height</code> and <code>overflow-y</code> values:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$advanced-search-panel-max-height: 800px;
  $advanced-search-panel-overflow-y: auto;
  
  :host ::ng-deep .mat-tab-body-content{  
    max-height: $advanced-search-panel-max-height;
    padding:5px;
    overflow-y: $advanced-search-panel-overflow-y;
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>On a laptop this <code>max-height</code> with <code>auto</code> doesn't show a scrollbar (i.e. you would normally see the Submit/Clear button at the bottom), which causes the content to become hidden at the bottom. For this reason I'd like to dynamically modify those two styles.</p>
  
  <p><a href="https://i.stack.imgur.com/XHmU4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XHmU4.png" alt="enter image description here"></a>
  Can I somehow assign those scss vars within my component code, or do I have to go with an <code>ElementRef</code> type ?</p>