OLD | NEW |
| (Empty) |
1 <!-- | |
2 @license | |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
7 Code distributed by Google as part of the polymer project is also | |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
9 --><html><head><link rel="import" href="../polymer/polymer.html"> | |
10 <link rel="import" href="../iron-meta/iron-meta.html"> | |
11 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> | |
12 | |
13 <!-- | |
14 | |
15 The `iron-icon` element displays an icon. By default an icon renders as a 24px s
quare. | |
16 | |
17 Example using src: | |
18 | |
19 <iron-icon src="star.png"></iron-icon> | |
20 | |
21 Example setting size to 32px x 32px: | |
22 | |
23 <iron-icon class="big" src="big_star.png"></iron-icon> | |
24 | |
25 <style> | |
26 .big { | |
27 height: 32px; | |
28 width: 32px; | |
29 } | |
30 </style> | |
31 | |
32 The iron elements include several sets of icons. | |
33 To use the default set of icons, import `iron-icons.html` and use the `icon` at
tribute to specify an icon: | |
34 | |
35 <!-- import default iconset and iron-icon --> | |
36 <link rel="import" href="/components/iron-icons/iron-icons.html"> | |
37 | |
38 <iron-icon icon="menu"></iron-icon> | |
39 | |
40 To use a different built-in set of icons, import `iron-icons/<iconset>-icons.ht
ml`, and | |
41 specify the icon as `<iconset>:<icon>`. For example: | |
42 | |
43 <!-- import communication iconset and iron-icon --> | |
44 <link rel="import" href="/components/iron-icons/communication-icons.html"> | |
45 | |
46 <iron-icon icon="communication:email"></iron-icon> | |
47 | |
48 You can also create custom icon sets of bitmap or SVG icons. | |
49 | |
50 Example of using an icon named `cherry` from a custom iconset with the ID `fruit
`: | |
51 | |
52 <iron-icon icon="fruit:cherry"></iron-icon> | |
53 | |
54 See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for
more information about | |
55 how to create a custom iconset. | |
56 | |
57 See [iron-icons](http://www.polymer-project.org/components/iron-icons/demo.html)
for the default set of icons. | |
58 | |
59 | |
60 ### Styling | |
61 | |
62 The following custom properties are available for styling: | |
63 | |
64 Custom property | Description | Default | |
65 ----------------|-------------|---------- | |
66 `--iron-icon-width` | Width of the icon | `24px` | |
67 `--iron-icon-height` | Height of the icon | `24px` | |
68 | |
69 @group Iron Elements | |
70 @element iron-icon | |
71 @demo demo/index.html | |
72 @hero hero.svg | |
73 @homepage polymer.github.io | |
74 --> | |
75 | |
76 <style is="custom-style"> | |
77 :root { | |
78 --iron-icon-width: 24px; | |
79 --iron-icon-height: 24px; | |
80 } | |
81 </style> | |
82 | |
83 </head><body><dom-module id="iron-icon"> | |
84 | |
85 <style> | |
86 :host { | |
87 @apply(--layout-inline); | |
88 @apply(--layout-center-center); | |
89 position: relative; | |
90 | |
91 vertical-align: middle; | |
92 | |
93 fill: currentcolor; | |
94 | |
95 width: var(--iron-icon-width); | |
96 height: var(--iron-icon-height); | |
97 } | |
98 </style> | |
99 | |
100 <template> | |
101 <iron-meta id="meta" type="iconset"></iron-meta> | |
102 </template> | |
103 | |
104 </dom-module> | |
105 | |
106 <script src="iron-icon-extracted.js"></script></body></html> | |
OLD | NEW |