@@ -13,7 +13,7 @@ import {MatSidenavModule} from '@angular/material/sidenav';
1313import { MatListModule } from '@angular/material/list' ;
1414import { MatButtonModule } from '@angular/material/button' ;
1515import { RouterModule } from '@angular/router' ;
16- import { MatIconModule } from '@angular/material/icon' ;
16+ import { MatIconModule , MatIconRegistry } from '@angular/material/icon' ;
1717import { MatToolbarModule } from '@angular/material/toolbar' ;
1818import { MatTooltipModule } from '@angular/material/tooltip' ;
1919import { DevAppDirectionality } from './dev-app-directionality' ;
@@ -110,12 +110,14 @@ export class DevAppLayout {
110110 @Inject ( Directionality ) private _dir : DevAppDirectionality ,
111111 private _changeDetectorRef : ChangeDetectorRef ,
112112 @Inject ( DOCUMENT ) private _document : Document ,
113+ private _iconRegistry : MatIconRegistry ,
113114 ) {
114115 this . toggleTheme ( this . state . darkTheme ) ;
115116 this . toggleStrongFocus ( this . state . strongFocusEnabled ) ;
116117 this . toggleDensity ( Math . max ( this . _densityScales . indexOf ( this . state . density ) , 0 ) ) ;
117118 this . toggleRippleDisabled ( this . state . rippleDisabled ) ;
118119 this . toggleDirection ( this . state . direction ) ;
120+ this . toggleM3 ( this . state . m3Enabled ) ;
119121 }
120122
121123 toggleTheme ( value = ! this . state . darkTheme ) {
@@ -168,9 +170,13 @@ export class DevAppLayout {
168170 ( document . getElementById ( 'theme-styles' ) as HTMLLinkElement ) . href = value
169171 ? 'theme-m3.css'
170172 : 'theme.css' ;
171- this . state . m3Enabled = value ;
172- setAppState ( this . state ) ;
173173 }
174+
175+ this . _iconRegistry . setDefaultFontSetClass (
176+ value ? 'material-symbols-outlined' : 'material-icons' ,
177+ ) ;
178+ this . state . m3Enabled = value ;
179+ setAppState ( this . state ) ;
174180 }
175181
176182 getDensityClass ( ) {
0 commit comments