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: Thistle;
}
`]
})
export class AppComponent { }
app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material - How to change
Accordion expanded panels header background color
</h2>
<mat-accordion multi displayMode="flat">
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>Assembly</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>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Bash/Shell</mat-panel-title>
</mat-expansion-panel-header>
Vivamus ornare ipsum sit amet imperdiet laoreet.
Cras maximus elementum varius. Integer nisi tellus,
dapibus vitae neque non, tempor vehicula velit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Swift</mat-panel-title>
</mat-expansion-panel-header>
Sed vitae felis id velit luctus elementum ut quis nisl. Curabitur
consectetur, ipsum eget vulputate mattis, odio dolor hendrerit
massa, eget scelerisque justo tellus eu lectus.
</mat-expansion-panel>
</mat-accordion>
app.module.ts [import]
import {MatExpansionModule} from '@angular/material/expansion'
- angular material - How to change Badge position
- angular material - How to toggle Badge visibility
- angular material - How to show Badge in a button
- angular material - How to use Accordion
- angular material - How to use Expansion Panel
- angular material - Action bar inside an Expansion Panel
- angular material - Expansion Panel opened & closed event
- angular material - How to use Accordion flat display mode
- angular material - Open & close Expansion Panel on button click
- angular material - Expansion Panel afterExpand & afterCollapse event
- angular material - How to initially expand Expansion Panel
- angular material - Expansion Panel header expanded background color
- angular material - How to use List
- angular material - List items separator
- angular material - How to generate List items from array