forked from google/material-design-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
409 lines (359 loc) · 21.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, width=device-width"/>
<link href="//fonts.googleapis.com/css?family=Roboto+Mono:400,500,700" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Roboto:400,500,700,400italic" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="www/css/material.css">
<title>Material icons guide - Google design</title>
</head>
<body class="icons-docs">
<header>
<div class="header-wrapper">
<div class="header-title">
<span class="section-title">Material icons guide</span>
</div>
</div>
</header>
<div id="page-container">
<div id="page-inner-container">
<p>An overview of material icons—where to get them and how to integrate them with your projects.</p>
<nav class="toc">
<h1>Contents</h1>
<ul>
<li><a href="#what-are-material-icons">What are material icons</a></li>
<li><a href="#getting-icons">Getting icons</a></li>
<li><a href="#icon-font-for-the-web">Icon font for the web</a></li>
<li><a href="#icon-images-for-the-web">Icon images for the web</a></li>
<li><a href="#icons-for-android">Icons for Android</a></li>
<li><a href="#icons-for-ios">Icons for iOS</a></li>
</ul>
</nav>
<h1 id="what-are-material-icons">What are material icons</h1>
<p>Material design system icons are simple, modern, friendly, and sometimes
quirky. Each icon is created using our design guidelines to depict in simple
and minimal forms the universal concepts used commonly throughout a UI.
Ensuring readability and clarity at both large and small sizes, these icons
have been optimized for beautiful display on all common platforms and display
resolutions.</p>
<p>See the full set of material design icons at the <a href="https://www.google.com/design/icons/">material icons library</a>.</p>
<div class="img"><a href="https://www.google.com/design/icons/"><img src="www/images/icons-library.png" alt="alt text"></a></div>
<h1 id="getting-icons">Getting icons</h1>
<p>The icons are available in several formats and are suitable for different types
of projects and platforms, for developers in their apps, and for designers in
their mockups or prototypes.</p>
<h2 id="licensing">Licensing</h2>
<p>We have made these icons available for you to incorporate them into your
products under the <a href="https://creativecommons.org/licenses/by/4.0/">Creative Common Attribution 4.0 International License (CC-BY 4.0)</a>. Feel free to remix and re-share these icons and documentation in your
products. We'd love attribution in your app's <em>about</em> screen, but it's not required. The only thing we ask is that you not re-sell
the icons themselves.</p>
<h2 id="browsing-and-downloading-individual-icons">Browsing and downloading individual icons</h2>
<p>The complete set of material icons are available on the <a href="https://www.google.com/design/icons/">material icon library</a>. The icons are available for download in SVG or PNGs, formats that are
suitable for web, Android, and iOS projects or for inclusion in any designer
tools.</p>
<h2 id="downloading-everything">Downloading everything</h2>
<p>Grab the <a href="https://github.com/google/material-design-icons/releases/download/2.0.0/material-design-icons-2.0.0.zip">latest stable zip archive</a> (~57MB) of all icons or the <a href="https://github.com/google/material-design-icons/archive/master.zip">bleeding-edge version from master.</a></p>
<h2 id="git-repository">Git Repository</h2>
<p>The material icons are available from the <a href="https://github.com/google/material-design-icons">git repository</a> which contains the complete set of icons including all the various formats we
are making available.</p>
<pre><code>$ git clone http://github.com/google/material-design-icons/
</code></pre><h2 id="installing-icons-from-bower">Installing icons from bower</h2>
<p>Install the icons using the <a href="http://bower.io/">Bower</a> package manager.</p>
<pre><code>$ bower install material-design-icons
</code></pre><h2 id="installing-icons-from-npm">Installing icons from npm</h2>
<p>Install the icons using <a href="http://npmjs.io/">npm</a> package manager.</p>
<pre><code>$ npm install material-design-icons
</code></pre><p><hr></p>
<h1 id="icon-font-for-the-web">Icon font for the web</h1>
<p>The material icon font is the easiest way to incorporate material icons with
web projects. We have packaged all the material icons into a single font that
takes advantage of the typographic rendering capabilities of modern browsers so
that web developers can easily incorporate these icons with only a few lines of
code.</p>
<p>Using the font is not only the most convenient method, but it is efficient and
looks great:</p>
<ul>
<li>750+ icons all from a single download.</li>
<li>Served from Google Web Font servers or can be self hosted.</li>
<li>Supported by all modern web browsers.</li>
<li>Colored, sized and positioned entirely with CSS.</li>
<li>Vector-based: Looks great at any scale, retina displays, low-dpi display
screens.</li>
</ul>
<p>The icon font contains 750+ icons and weighs in at only 40KB (woff2 format). In
comparison, a ZIP file of these in SVGs will be more than 50% larger.</p>
<h2 id="setup-method-1-using-via-google-web-fonts">Setup Method 1. Using via Google Web Fonts</h2>
<p>The easiest way to set up icon fonts for use in any web page is through <a href="https://developers.google.com/fonts/">Google Web Fonts</a>. All you need to do is include a single line of HTML:</p>
<pre><code><link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
</code></pre><p>Similar to other Google Web Fonts, the correct CSS will be served to activate
the 'Material Icons' font specific to the browser. An additional CSS class will
be declared called <code>.material-icons</code>. Any element that uses this class will have the correct CSS to render these
icons from the web font.</p>
<h2 id="setup-method-2-self-hosting">Setup Method 2. Self hosting</h2>
<p>For those looking to self host the web font, some additional setup is necessary.
Host the <a href="https://github.com/google/material-design-icons/tree/master/iconfont">icon font</a> in a location, for example <code>https://example.com/material-icons.woff</code> and add the
following CSS rule:</p>
<pre><code>@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(https://example.com/MaterialIcons-Regular.woff2) format('woff2'),
url(https://example.com/MaterialIcons-Regular.woff) format('woff'),
url(https://example.com/MaterialIcons-Regular.ttf) format('truetype');
}
</code></pre><p>In addition, the CSS rules for rendering the icon will need to be declared.
These rules are normally served as part of the Google Web Font stylesheet, but
will need to be included manually in your projects when self-hosting the font:</p>
<pre><code>.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
width: 1em;
height: 1em;
line-height: 1;
text-transform: none;
letter-spacing: normal;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
</code></pre><h2 id="using-the-icons-in-html">Using the icons in HTML</h2>
<p>It’s easy to incorporate icons into your web page. Here’s a small example:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons">face</i></div>
<div class="icons-code"><code><i
class="material-icons">face</i></code></div>
<p></div></p>
<p>This example uses a typographic feature called <a href="http://alistapart.com/article/the-era-of-symbol-fonts">ligatures</a>, which allows rendering of an icon glyph simply by using its textual name. The replacement is done automatically by the web browser and provides more readable code than the equivalent numeric character reference.</p>
<p>This feature is supported in most modern browsers on both desktop and mobile
devices.</p>
<table>
<tr>
<td><strong>Browser</strong></td>
<td><strong>Version supporting ligatures</strong></td>
</tr>
<tr>
<td>Google Chrome</td>
<td>11</td>
</tr>
<tr>
<td>Mozilla Firefox</td>
<td>3.5</td>
</tr>
<tr>
<td>Apple Safari</td>
<td>5</td>
</tr>
<tr>
<td>Microsoft IE</td>
<td>10</td>
</tr>
<tr>
<td>Opera</td>
<td>15</td>
</tr>
<tr>
<td>Apple MobileSafari</td>
<td>iOS 4.2</td>
</tr>
<tr>
<td>Android Browser</td>
<td>3.0</td>
</tr>
</table>
<p>For browsers that do not support ligatures, fall back to specifying the icons
using numeric character references like the example below:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons"></i></div>
<div class="icons-code"><code><i
class="material-icons">&#xE87C;</i></code></div>
<p></div></p>
<p>Find both the icon names and codepoints on the <a href="https://www.google.com/design/icons/">material icons library</a> by selecting any icon and opening the icon font panel. A <a href="https://github.com/google/material-design-icons/blob/master/iconfont/codepoints">codepoints index</a> is also available on our git repository which shows the complete set of names
and character codes.</p>
<h2 id="styling-icons-in-material-design">Styling icons in material design</h2>
<p>These icons were designed to follow the <a href="https://www.google.com/design/spec/style/icons.html">material design guidelines</a> and they look best when using the recommended icon sizes and colors. The styles below make it easy to apply our recommended sizes, colors, and activity states.</p>
<pre><code>// Rules for sizing the icon.
.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }
// Rules for using icons as black on a light background.
.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
// Rules for using icons as white on a dark background.
.material-icons.md-light { color: rgba(255, 255, 255, 1); }
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
</code></pre><h3 id="sizing">Sizing</h3>
<p>Although the icons in the font can be scaled to any size, in accordance with <a href="https://www.google.com/design/spec/style/icons.html#icons-system-icons">material design icons guidelines</a>, we recommend them to be shown in either 18, 24, 36 or 48px. The default being
24px.</p>
<p>CSS rules for the standard material design sizing guidelines:</p>
<pre><code>.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }
</code></pre><p>Material icons look best at 24px, but if an icon needs to be displayed in an
alternative size, using the above CSS rules can help:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-18">face</i><div
class="icon-caption">18px</div></div>
<div class="icons-code"><code><i class="material-icons
md-18">face</i></code></div>
<p></div></p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-24">face</i><div
class="icon-caption">24px</div></div>
<div class="icons-code"><code><i class="material-icons
md-24">face</i></code></div>
<p></div></p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-36">face</i><div
class="icon-caption">36px</div></div>
<div class="icons-code"><code><i class="material-icons
md-36">face</i></code></div>
<p></div></p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-48">face</i><div
class="icon-caption">48px</div></div>
<div class="icons-code"><code><i class="material-icons
md-48">face</i></code></div>
<p></div></p>
<h3 id="coloring">Coloring</h3>
<p>Using the icon font allows for easy styling of an icon in any color.
In accordance with <a href="https://www.google.com/design/spec/style/icons.html#icons-system-icons">material design icon guidelines</a>, for active icons we recommend using either black at 54% opacity or white at
100% opacity when displaying these on light or dark backgrounds, respectively.
If an icon is disabled or inactive, using black at 26% or white at 30% for
light and dark backgrounds, respectively.</p>
<p>Here are some examples, using the material CSS styles described above:</p>
<pre><code>.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
.material-icons.md-light { color: rgba(255, 255, 255, 1); }
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
</code></pre><p>Example for drawing an icon on a light background with a dark foreground color:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-dark">face</i><div
class="icon-caption">Normal</div></div>
<div class="icons-code"><code><i class="material-icons
md-dark">face</i></code></div>
<p></div></p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-dark
md-inactive">face</i><div class="icon-caption">Disabled</div></div>
<div class="icons-code"><code><i class="material-icons
md-dark md-inactive">face</i></code></div>
<p></div></p>
<p>Example for drawing an icon on a dark background with a light foreground color:</p>
<div class="icons-preview-code">
<div class="icons-preview icons-dark-bg"><i class="material-icons
md-light">face</i><div class="icon-caption">Normal</div></div>
<div class="icons-code"><code><i class="material-icons
md-light">face</i></code></div>
<p></div></p>
<div class="icons-preview-code">
<div class="icons-preview icons-dark-bg"><i class="material-icons md-light
md-inactive">face</i><div class="icon-caption">Disabled</div></div>
<div class="icons-code"><code><i class="material-icons
md-light md-inactive">face</i></code></div>
<p></div></p>
<p>To set a custom icon color, define a CSS rule specifying the desired color for
the font:</p>
<pre><code>.material-icons.orange600 { color: #FB8C00; }
</code></pre><p>and then use the class when referring to the icon:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons orange600">face</i><div
class="icon-caption">Normal</div></div>
<div class="icons-code"><code><i class="material-icons
orange600">face</i></code></div>
<p></div></p>
<p><hr></p>
<h1 id="icon-images-for-the-web">Icon images for the web</h1>
<p>Material icons are also available as regular images, both in PNG and SVG
formats.</p>
<h2 id="svg">SVG</h2>
<p>The material icons are provided as SVGs that are suitable for web projects.
Individual icons are downloadable from the <a href="https://www.google.com/design/icons/">material icons library</a>. The SVGs are also available from the material design icons <a href="https://github.com/google/material-design-icons/">git repository</a> under the path:</p>
<pre><code>material-design-icons/*/svg/production/
</code></pre><p>For example, icons for maps are in <a href="https://github.com/google/material-design-icons/tree/master/maps/svg/production">maps/svg/production</a>:</p>
<pre><code>material-design-icons/maps/svg/production/
</code></pre><p>If multiple icons are in use on a web site, creating spritesheets out of the
images is recommended. For more information, refer to the documentation in the <a href="https://github.com/google/material-design-icons/tree/master/sprites">sprites directory of the git repository</a>.</p>
<h2 id="png">PNG</h2>
<p>PNG is the most traditional way to display icons on the web. Our downloads from
the <a href="https://www.google.com/design/icons/">material icons library</a> provide both single and double densities for each icon. They are referred to
as <code>1x_web</code> and <code>2x_web</code> respectively in the download. Icons are also available in the git repository
under:</p>
<pre><code>material-design-icons/*/1x_web/
material-design-icons/*/2x_web/
</code></pre><p>If multiple icons are in use on a web site, creating spritesheets out of the
images is recommended. For more information, refer to recommendations in the <a href="https://github.com/google/material-design-icons/tree/master/sprites">sprites directory in the git repository</a>.</p>
<p><hr></p>
<h1 id="icons-for-android">Icons for Android</h1>
<p>PNGs suitable for Android are available from the <a href="https://www.google.com/design/icons/">material icons library</a>. These come in all the supported screen densities so they should look good on
any device.</p>
<p>The icons are also available in the <a href="https://github.com/google/material-design-icons">material design icons git repository</a> in the same combination of colors and sizes named as follows:</p>
<pre><code>*/drawable-{{density}}/ic_{{name}}_{{color}}_{{size}}dp.png
</code></pre><p>A density-independent VectorDrawable is provided which is supported from
Android Lollipop and later:</p>
<pre><code>*/drawable-anydpi-v21/ic_{{name}}_black_24dp.xml
</code></pre><p>The Vector Drawable is currently only available as a black 24dp icon. This is
for compatibility with our most standard icon size. To render the icon in a
different color, use <a href="https://developer.android.com/training/material/drawables.html">drawable tinting available on Android Lollipop</a>.</p>
<p>When using the Vector Drawable, it may not be necessary to include the xxxhdpi
density PNG since it is unlikely a device supporting that screen density does
not support Vector Drawables.</p>
<p><hr></p>
<h1 id="icons-for-ios">Icons for iOS</h1>
<p>Material icons also work well within iOS apps. In both the <a href="https://www.google.com/design/icons/">material icons library</a> and <a href="http://github.com/google/material-design-icons/">git repository</a>, these icons are packaged up in <a href="https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/AddingImageSets.html">Xcode imagesets</a> which will work easily with <a href="https://developer.apple.com/library/mac/recipes/xcode_help-image_catalog-1.0/Recipe.html">Xcode Asset Catalogs</a> (xcassets). These imagesets can be added to any Xcode Asset Catalogs by
dragging them into Xcode on to the asset catalog or by copying the folder into
the xcasset folder.</p>
<div class="img"><img src="www/images/ios-imageset.png" alt="alt text"></div>
<p>The imageset contains the single, double and triple density images (1x, 2x, 3x)
so they work on all known iOS screen densities. Both black and white icons are
provided, but we recommend using <a href="https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImage_Class/#//apple_ref/occ/instm/UIImage/imageWithRenderingMode:">UIImage's imageWithRenderingMode</a> with <a href="https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImage_Class/#//apple_ref/c/tdef/UIImageRenderingMode">UIImageRenderingModeAlwaysTemplate</a> which will allow the image to be used as an alpha mask that can be tinted to
any possible color.</p>
<p>Objective-C example:</p>
<pre><code>UIButton *button = [[UIButton alloc] init];
UIImage *closeImage =
[[UIImage imageNamed:@"ic_close"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
button.tintColor = [UIColor colorWithWhite:0 alpha:0.54f];
[button setImage:closeImage forState:UIControlStateNormal];
</code></pre><p>Swift Example:</p>
<pre><code>let button = UIButton()
let closeImage = UIImage(named:"ic_close")?.imageWithRenderingMode(
UIImageRenderingMode.AlwaysTemplate)
button.tintColor = UIColor(white:0, alpha:0.54)
button.setImage(closeImage, forState:UIControlState.Normal)
</code></pre>
</div><!-- page-inner-container -->
</div><!-- page-container -->
<!-- footer -->
<footer>
<div class="logo"><a href="https://www.google.com/"><img class="google-logo" alt="Google" src="www/images/google-logo.png"></a></div>
<div class="links right">
<a href="https://www.google.com/intl/en/about/">About</a><span class="dot">·</span>
<a href="https://www.google.com/intl/en/policies/">Privacy & Terms</a>
</div>
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-51798601-4', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>