You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: docs/polymer/icons.md
+203-14
Original file line number
Diff line number
Diff line change
@@ -9,29 +9,218 @@ subtitle: Guide
9
9
10
10
{% include toc.html %}
11
11
12
-
{{site.project_title}} provides a standard set of SVG icons (styleable using CSS), elements for working with individual icons, and elements for working with icon sets.
12
+
{{site.project_title}}'s Core Elements provide utility components
13
+
for working with individual icons and icon sets.
13
14
14
-
TODO
15
+
It includes a standard collection of SVG icons (styleable using CSS) as well as elements to
16
+
create your own icon sets in SVG or bitmap, if needed.
15
17
16
-
## Basic usage
18
+
## Installation
17
19
18
-
TODO
20
+
This article describes the usage of four components: `core-icon`,
21
+
`core-icons`, `core-iconset` and `core-iconset-svg`.
22
+
You can install them using Bower:
19
23
20
-
<core-icon icon="search"></core-icon>
24
+
bower install Polymer/core-icon
25
+
bower install Polymer/core-icons
26
+
bower install Polymer/core-iconset
27
+
bower install Polymer/core-iconset-svg
21
28
22
-
Produces: <core-iconicon="search"></core-icon>
29
+
The rest of this article assumes the components are
30
+
installed in the `bower_components` directory.
23
31
24
-
## Using an icon set
25
32
26
-
- loading
27
-
- using
33
+
## Basic usage: core-icon
34
+
35
+
The simplest way of using Polymer icons is the `core-icon` element.
36
+
To use it, import *core-icon.html* and declare an icon in your html:
The source image is scaled to fit the icon size, which defaults to 24px square, and is used as the icon element’s background.
45
+
46
+
You can control the size of the icon using the `size` attribute. Since icons are always square, the `size` specifies both the width and the height of the icon, in pixels.
The `src` attribute works well when you want to use a single icon. However, most of the time you need more than one, so Polymer makes it easy to work with *icon sets*.
58
+
59
+
60
+
## Using Polymer's built-in icon sets
61
+
62
+
If you import `core-icons`, you get access to
63
+
a whole range of predefined icon sets. To use an icon from an icon set, use the `icon` attribute instead of `src`:
You can use icons on their own, but also use them with other elements, such as buttons. You can use the built-in and custom icon sets with any `core-` element that has an `icon` attribute. Remember to include the appropriate icon set
197
+
before refering to an icon, otherwise the icon
198
+
will not render.
199
+
200
+
Here is an example of `core-icon-button`, `core-menu-button` and `core-item` using
0 commit comments