Skip to main content

angular material - Expansion Panel header expanded background color

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styles: [`
    .mat-expansion-panel.mat-expanded
    .mat-expansion-panel-header{
      background: LightBlue;
    }
  `]
})


export class AppComponent { }
app.component.html

<h2 style="padding-top:25px; padding-bottom:25px;">
  Angular Material - How to change Expansion Panel
    header expanded background color
</h2>


<mat-expansion-panel>
  <mat-expansion-panel-header>
    <mat-panel-title>Dart</mat-panel-title>
  </mat-expansion-panel-header>

  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  Integer vitae semper massa. Donec maximus, dui nec
  dignissim blandit, ante odio varius ex,
  nec volutpat erat justo ac magna.

</mat-expansion-panel>
app.module.ts [import]

import {MatExpansionModule} from '@angular/material/expansion'
More Angular tutorials