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 | |
12 <!-- | |
13 The `iron-iconset` element allows users to define their own icon sets. | |
14 The `src` property specifies the url of the icon image. Multiple icons may | |
15 be included in this image and they may be organized into rows. | |
16 The `icons` property is a space separated list of names corresponding to the | |
17 icons. The names must be ordered as the icons are ordered in the icon image. | |
18 Icons are expected to be square and are the size specified by the `size` | |
19 property. The `width` property corresponds to the width of the icon image | |
20 and must be specified if icons are arranged into multiple rows in the image. | |
21 | |
22 All `iron-iconset` elements are available for use by other `iron-iconset` | |
23 elements via a database keyed by id. Typically, an element author that wants | |
24 to support a set of custom icons uses a `iron-iconset` to retrieve | |
25 and use another, user-defined iconset. | |
26 | |
27 Example: | |
28 | |
29 <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" | |
30 icons="location place starta stopb bus car train walk"> | |
31 </iron-iconset> | |
32 | |
33 This will automatically register the icon set "my-icons" to the iconset | |
34 database. To use these icons from within another element, make a | |
35 `iron-iconset` element and call the `byId` method to retrieve a | |
36 given iconset. To apply a particular icon to an element, use the | |
37 `applyIcon` method. For example: | |
38 | |
39 iconset.applyIcon(iconNode, 'car'); | |
40 | |
41 Themed icon sets are also supported. The `iron-iconset` can contain child | |
42 `property` elements that specify a theme with an offsetX and offsetY of the | |
43 theme within the icon resource. For example. | |
44 | |
45 <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" | |
46 icons="location place starta stopb bus car train walk"> | |
47 <property theme="special" offsetX="256" offsetY="24"></property> | |
48 </iron-iconset> | |
49 | |
50 Then a themed icon can be applied like this: | |
51 | |
52 iconset.applyIcon(iconNode, 'car', 'special'); | |
53 | |
54 @element iron-iconset | |
55 --> | |
56 | |
57 </head><body><script src="iron-iconset-extracted.js"></script></body></html> | |
OLD | NEW |