Skip to content
Joen Asmussen edited this page Mar 31, 2016 · 6 revisions

This icon set uses some tools to automate the building process. Here are the instructions for:

  • svg-min, React, svg-sprite
  • pdf

Standard Install: to Generate svg-min, React and svg-sprite

  1. Go to http://nodejs.org/ and press "Install". Follow instructions.
  2. Open a terminal window. Change to your Gridicons git folder.
  3. Type npm install -g grunt-cli to install Grunt.
  4. Type npm install to install Gridicons build libraries.
  5. Done!

You're ready to build the set by typing grunt in the Gridicons folder.

Note: If something doesn't work, first thing check you have grunt and grunt-svgstore installed (also might require grunt-svgmin). Type npm ls in the Gridicons folder to see the full list.

Extra Install: to Generate pdf

Gridicons comes with a shell-script that will make highly optimized 1:1 size PDF versions of every SVG found in svg-min. These are not automatically make by the grunt script.

You need to have CairoSVG installed:

sudo easy_install pip
sudo pip install cairosvg
brew install cairo

To make PDF versions, open a commandline in the gridicons directory type:

sh makepdfs.sh

Now every icon in the svg-min folder will have been converted to PDFs in the pdf folder.

Since this script isn't automatically run by grunt (due to the extra dependencies not installed by npm install), we should just run this script every once in a while (when you need a PDF icon that isn't baked, basically).

Note: cairosvg outputs its version number in the PDF files it generates. We can't turn this off. But this means if you run the script and suddenly see all the PDFs as changed when running git status, this is likely because your version of Cairo was newer or older than the version a previous committer used. This is okay, but probably a good idea if you check you're on the newest version of Cairo:

  • brew update
  • brew upgrade cairo
Clone this wiki locally