OLD | NEW |
1 | 1 /** |
2 /** | |
3 * The `iron-iconset-svg` element allows users to define their own icon sets | 2 * The `iron-iconset-svg` element allows users to define their own icon sets |
4 * that contain svg icons. The svg icon elements should be children of the | 3 * that contain svg icons. The svg icon elements should be children of the |
5 * `iron-iconset-svg` element. Multiple icons should be given distinct id's. | 4 * `iron-iconset-svg` element. Multiple icons should be given distinct id's. |
6 * | 5 * |
7 * Using svg elements to create icons has a few advantages over traditional | 6 * Using svg elements to create icons has a few advantages over traditional |
8 * bitmap graphics like jpg or png. Icons that use svg are vector based so the
y | 7 * bitmap graphics like jpg or png. Icons that use svg are vector based so the
y |
9 * are resolution independent and should look good on any device. They are | 8 * are resolution independent and should look good on any device. They are |
10 * stylable via css. Icons can be themed, colorized, and even animated. | 9 * stylable via css. Icons can be themed, colorized, and even animated. |
11 * | 10 * |
12 * Example: | 11 * Example: |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); | 167 svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); |
169 // TODO(dfreedm): `pointer-events: none` works around https://crbug.com/
370136 | 168 // TODO(dfreedm): `pointer-events: none` works around https://crbug.com/
370136 |
170 // TODO(sjmiles): inline style may not be ideal, but avoids requiring a
shadow-root | 169 // TODO(sjmiles): inline style may not be ideal, but avoids requiring a
shadow-root |
171 svg.style.cssText = 'pointer-events: none; display: block; width: 100%;
height: 100%;'; | 170 svg.style.cssText = 'pointer-events: none; display: block; width: 100%;
height: 100%;'; |
172 svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id'); | 171 svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id'); |
173 return svg; | 172 return svg; |
174 } | 173 } |
175 return null; | 174 return null; |
176 } | 175 } |
177 | 176 |
178 }); | 177 }); |
OLD | NEW |