title: Dynamically set the background color of mat-tab
body: <p>I want to be able to set the color of the tab according to a condition like i'm doing on the div in the provided stackblitz project with the content class. If the <code>selectedMarketStatus === marketStatus.Open</code> statement is true i want both the content div and the tab to be green. Is this possible? If so how do i do it?</p>
  
  <p>Edit: updated the blitz which kind of does what i wanted, the scss style on the &amp;-closed does not work on stackblitz but it works in my project.</p>
  
  <p><a href="https://stackblitz.com/edit/angular-5jtkr3-abyl6r?file=app%2Ftab-group-theme-example.html" rel="nofollow noreferrer">Stackblitz</a> </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-js lang-js prettyprint-override"><code>export class TabGroupThemeExample {
    public marketStatus = MarketPurchaseStatus;
    public selectedMarketStatus = this.marketStatus.Open;
    constructor() {}
  }
  
  export enum MarketPurchaseStatus {
    BeforeOpen = 0,
      Open = 1,
      AfterClose = 2
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.content {
    background-color: gray;
  }
  
  .open {
    background-color: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;mat-tab-group class="subscription-market-tabs" [animationDuration]="0" [disableRipple]="true"&gt;
    &lt;mat-tab&gt;
      &lt;ng-template mat-tab-label&gt;aaaa&lt;/ng-template&gt;
    &lt;/mat-tab&gt;
    &lt;mat-tab [disabled]="selectedMarketStatus === marketStatus.AfterClosed"&gt;
      &lt;ng-template mat-tab-label&gt;bbbb&lt;/ng-template&gt;
    &lt;/mat-tab&gt;
  &lt;/mat-tab-group&gt;
  &lt;div class="content" [class.open]="selectedMarketStatus === marketStatus.Open"&gt;aaaaaa&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>