Glyph is a collection of ~800 beautiful pixel-perfect SVG icons, designed for the modern web. Glyph is 16x16, but because it's SVG, it can be any size you want.
- Fixed some typos.
- Sprite generator.
There are many ways to put an SVG icon into your web page.
<img src="svg/si-glyph-bicycle-man.svg">
Or you can copy the SVG content and paste it into your HTML.
An elegant way to use SVG icons is SVG sprite, demonstrated in sample.html
.
<svg xmlns="http://www.w3.org/2000/svg" class="si-glyph-bubble-message-hi">
<use xlink:href="sprite.svg#si-glyph-bubble-message-hi" />
</svg>
This method makes use of the <use>
tag to link a part of SVG content from a SVG sprite file into your HTML.
The icon web component provides a great way to embed icons in your design by using a custom tag. Please check sprite/sample-iwc.html
for code snippets.
<svg-icon>
<src href="sprite.svg#si-glyph-bubble-message-hi"/>
</svg-icon>
Using inline SVG and web component methods, you can style your icon with CSS easily. Glyph is carefully made so that you can change all or some icons color with just these simple CSS snippet below.
Style the whole set
.si-glyph * {
fill: red;
}
Style some specified icons
.si-glyph-bubble-message-hi {
fill: blue;
}
From version 1.1, Glyph comes with a custom sprite generator script. You need Node.js in order to use this script.
With your favorite terminal, change to the glyph directory, then:
node generator/generate.js
A few options:
-f <csv-file>
path to a one-column CSV file specified what icon you want to include in the sprite.-l <list-of-icons>
a list of icons separated by commas. For example: bubble-message-hi,camera,car,alarm-clock-o <path-to-sprite>
path lead to the output sprite file.
For example:
node generator/generate.js -l camera,car,alarm-clock -o some-icons.sprite
- New icons.
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)