Skip to content

Commit 57efa13

Browse files
crisbetotinayuangao
authored andcommitted
feat(icon): allow SVG icons to be registered from strings (#10757)
Expands the icon registry to allow for icons and icon sets to be registered using a trusted HTML string. Fixes #3132.
1 parent 603dfa4 commit 57efa13

File tree

6 files changed

+465
-81
lines changed

6 files changed

+465
-81
lines changed
Lines changed: 119 additions & 33 deletions
Loading

src/demo-app/icon/icon-demo.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@
99
<mat-icon svgIcon="thumb-up"></mat-icon>
1010
</p>
1111

12+
<p>
13+
From inline template with MatIconProvider:
14+
<mat-icon svgIcon="bike" class="green"></mat-icon>
15+
<mat-icon svgIcon="bike"></mat-icon>
16+
</p>
17+
1218
<p>
1319
Mirrored in RTL:
1420
<mat-icon class="mat-icon-rtl-mirror green" svgIcon="thumb-up"></mat-icon>
1521
<mat-icon class="mat-icon-rtl-mirror" svgIcon="thumb-up"></mat-icon>
22+
<mat-icon class="mat-icon-rtl-mirror green" svgIcon="bike"></mat-icon>
23+
<mat-icon class="mat-icon-rtl-mirror" svgIcon="bike"></mat-icon>
1624
</p>
1725

1826
<p>
@@ -22,6 +30,13 @@
2230
<mat-icon svgIcon="core:alarm"></mat-icon>
2331
</p>
2432

33+
<p>
34+
From inline icon set:
35+
<mat-icon svgIcon="core-inline:account-balance"></mat-icon>
36+
<mat-icon svgIcon="core-inline:account-balance-wallet"></mat-icon>
37+
<mat-icon svgIcon="core-inline:account-box"></mat-icon>
38+
</p>
39+
2540
<p>
2641
Ligature from Material Icons font:
2742
<mat-icon>home</mat-icon>

0 commit comments

Comments
 (0)