@gapminder/dollar-street-icons
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@gapminder/dollar-street-icons", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Font Awesome icon library for Dollar Street by GapMinder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ # @GapMinder/dollar-street-icons - for Font Awesome | ||
## [List of icons](icons.md) | ||
## [List of icons](docs/icons.md) | ||
@@ -28,65 +28,6 @@ ## Installation | ||
## How to add icons (6 steps) | ||
## [Editing the icon set](docs/editing.md) | ||
#### 1) Install development dependencies | ||
``` | ||
yarn install | ||
``` | ||
#### 2) Add SVG files | ||
Create your SVG file, and make sure it's a "compound path". _(Illustrator: `Object > Compound Path > Make`)_. Add to the `src` folder. Name the icon as you wish to call it in Font Awesome, lower-case hyphenated. | ||
#### 3) Create icon JS file | ||
Create a file with name `dsIconName.js`, mimicking the format of previous icons. Note the comments in the example code below: | ||
```javascript | ||
'use strict' | ||
Object.defineProperty(exports, '__esModule', { value: true }) | ||
var prefix = 'ds' | ||
var iconName = 'house' // SVG file name | ||
var width = 48 // width of viewBox | ||
var height = 48 // height of viewBox | ||
var ligatures = [] | ||
var unicode = 'e001' | ||
var svgPathData = 'M48,23.15L23.99,0L0,23.15h6.22V48h35.54V23.15H48z' // SVG path | ||
exports.definition = { | ||
prefix: prefix, | ||
iconName: iconName, | ||
icon: [width, height, ligatures, unicode, svgPathData], | ||
} | ||
exports.dsHouse = exports.definition // this file name | ||
exports.prefix = prefix | ||
exports.iconName = iconName | ||
exports.width = width | ||
exports.height = height | ||
exports.ligatures = ligatures | ||
exports.unicode = unicode | ||
exports.svgPathData = svgPathData | ||
``` | ||
#### 4) insert SVG path data | ||
If your SVG is a compound path, open the file in your image editor, copy to clipboard, then paste into a text editor. Find the SVG path similar to the example above and make sure it's one line only. That's the `svgPathData`. The width and height values can be found in the SVG attribute as `viewBox="0 0 W H"`; | ||
#### 5) Run the build script: | ||
``` | ||
yarn build | ||
``` | ||
#### 6) Publish to NPM | ||
> ⚠️ You need to be the owner of the package to do the following | ||
``` | ||
npm publish | ||
``` | ||
## Issues and support | ||
[GitHub issues](https://github.com/GapMinder/dollar-street-icons/issues) |
294986
32