@@ -38,17 +38,21 @@ explicitly set by calling `MatIconRegistry.setDefaultFontSetClass`.
38
38
### SVG icons
39
39
40
40
When an ` mat-icon ` component displays an SVG icon, it does so by directly inlining the SVG content
41
- into the page as a child of the component. (Rather than using an ` <img> ` tag or a div background
41
+ into the page as a child of the component. (Rather than using an ` <img> ` tag or a ` div ` background
42
42
image). This makes it easier to apply CSS styles to SVG icons. For example, the default color of the
43
43
SVG content is the CSS
44
44
[ currentColor] ( https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentColor_keyword )
45
45
value. This makes SVG icons by default have the same color as surrounding text, and allows you to
46
- change the color by setting the " color" style on the ` mat-icon ` element.
46
+ change the color by setting the ` color ` style on the ` mat-icon ` element.
47
47
48
48
In order to prevent XSS vulnerabilities, any SVG URLs and HTML strings passed to the
49
49
` MatIconRegistry ` must be marked as trusted by using Angular's ` DomSanitizer ` service.
50
50
51
- Also note that all SVG icons, registered by URL, are fetched via XmlHttpRequest, and due to the
51
+ To fetch remote SVG icons, the ` MatIconRegistry ` uses Angular's ` HttpClient ` service. If you haven't
52
+ included the [ ` HttpClientModule ` from the ` @angular/common/http ` package] ( https://angular.io/guide/http )
53
+ in your module's ` imports ` , you will get an error at runtime.
54
+
55
+ Note that all SVG icons, registered by URL, are fetched via XmlHttpRequest, and due to the
52
56
same-origin policy, their URLs must be on the same domain as the containing page, or their servers
53
57
must be configured to allow cross-domain access.
54
58
@@ -107,8 +111,8 @@ some icon on the page, a more appropriate element should "own" the interaction:
107
111
direct text content, ` aria-label ` , or ` aria-labelledby ` .
108
112
109
113
#### Indicator icons
110
- When the presence of an icon communicates some information to the user whether as an indicator or
111
- by being inlined into a block of text, that information must also be made available to
114
+ When the presence of an icon communicates some information to the user whether as an indicator or
115
+ by being inlined into a block of text, that information must also be made available to
112
116
screen-readers. The most straightforward way to do this is to
113
117
1 . Add a ` <span> ` as an adjacent sibling to the ` <mat-icon> ` element with text that conveys the same
114
118
information as the icon.
@@ -118,7 +122,7 @@ on-screen but still available to screen-reader users.
118
122
### Bidirectionality
119
123
120
124
By default icons in an RTL layout will look exactly the same as in LTR, however certain icons have
121
- to be [ mirrored for RTL users] ( https://material.io/guidelines /usability/bidirectionality.html ) . If
125
+ to be [ mirrored for RTL users] ( https://material.io/design /usability/bidirectionality.html ) . If
122
126
you want to mirror an icon only in an RTL layout, you can use the ` mat-icon-rtl-mirror ` CSS class.
123
127
124
128
``` html
0 commit comments