@@ -39,16 +39,16 @@ explicitly set by calling `MatIconRegistry.setDefaultFontSetClass`.
39
39
When an ` mat-icon ` component displays an SVG icon, it does so by directly inlining the SVG content
40
40
into the page as a child of the component. (Rather than using an <img > tag or a div background
41
41
image). This makes it easier to apply CSS styles to SVG icons. For example, the default color of the
42
- SVG content is the CSS
43
- [ currentColor] ( https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentColor_keyword )
44
- value. This makes SVG icons by default have the same color as surrounding text, and allows you to
42
+ SVG content is the CSS
43
+ [ currentColor] ( https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentColor_keyword )
44
+ value. This makes SVG icons by default have the same color as surrounding text, and allows you to
45
45
change the color by setting the "color" style on the ` mat-icon ` element.
46
46
47
- In order to prevent XSS vulnerabilities, any SVG URLs passed to the ` MatIconRegistry ` must be
47
+ In order to prevent XSS vulnerabilities, any SVG URLs passed to the ` MatIconRegistry ` must be
48
48
marked as trusted resource URLs by using Angular's ` DomSanitizer ` service.
49
49
50
- Also note that all SVG icons are fetched via XmlHttpRequest, and due to the same-origin policy,
51
- their URLs must be on the same domain as the containing page, or their servers must be configured
50
+ Also note that all SVG icons are fetched via XmlHttpRequest, and due to the same-origin policy,
51
+ their URLs must be on the same domain as the containing page, or their servers must be configured
52
52
to allow cross-domain access.
53
53
54
54
#### Named icons
@@ -74,8 +74,8 @@ more than one icon set, the icon from the most recently registered set will be u
74
74
75
75
### Theming
76
76
77
- By default, icons will use the current font color (` currentColor ` ). this color can be changed to
78
- match the current theme's colors using the ` color ` attribute. This can be changed to
77
+ By default, icons will use the current font color (` currentColor ` ). this color can be changed to
78
+ match the current theme's colors using the ` color ` attribute. This can be changed to
79
79
` 'primary' ` , ` 'accent' ` , or ` 'warn' ` .
80
80
81
81
### Accessibility
@@ -91,6 +91,16 @@ In thinking about accessibility, it is useful to place icon use into one of thre
91
91
2 . ** Interactive** : a user will click or otherwise interact with the icon to perform some action.
92
92
3 . ** Indicator** : the icon is not interactive, but it conveys some information, such as a status.
93
93
94
+ ### Bidirectionality
95
+
96
+ By default icons in an RTL layout will look exactly the same as in LTR, however certain icons have
97
+ to be [ mirrored for RTL users] ( https://material.io/guidelines/usability/bidirectionality.html ) . If
98
+ you want to mirror an icon only in an RTL layout, you can use the ` mat-icon-rtl-mirror ` CSS class.
99
+
100
+ ``` html
101
+ <mat-icon class =" mat-icon-rtl-mirror" svgIcon =" thumb-up" ></mat-icon >
102
+ ```
103
+
94
104
#### Decorative icons
95
105
When the icon is puely cosmetic and conveys no real semantic meaning, the ` <mat-icon> ` element
96
106
should be marked with ` aria-hidden="true" ` .
0 commit comments