Created
May 9, 2016 21:56
-
-
Save jxnblk/7f11eb4ac32c0b756ee67a45a1854ca6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Node script to console log a data uri | |
* from geomicons-open paths. | |
* Useful for using the SVGs as background images in CSS. | |
*/ | |
const Datauri = require('datauri') | |
const icons = require('geomicons-open') | |
const datauri = new Datauri() | |
const path = icons.paths.check | |
const color = '#fff' | |
const svg = ` | |
<svg | |
xmlns='http://www.w3.org/2000/svg' | |
viewBox='0 0 32 32' | |
width='32' height='32' | |
fill='${color}' | |
> | |
<path d='${path}' /> | |
</svg> | |
`.replace(/\n/g, '') | |
datauri.format('.svg', svg) | |
const uri = datauri.content | |
console.log(uri) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment