Module for generate SVG sprites and PNG fallback that used in m.vk.com
Inkscape (>= 0.48.5)
Node.JS (>= 8)
npm install @vkontakte/sprites
or yarn add @vkontakte/sprites
See demo/index.js
To generate Sprites you just need to run
generate(path, output = {}, converter, options)
path
is place on your filesystem where module loads SVG iconsconverter
see PNG Fallback section
In this time there is single PNG converter Inkscape
, but you can PR your if you need. It is simple, you just need to extend BaseConverter
To create PNG converter you need to import it
const InkscapeConverter = require("@vkontakte/sprites/src/convert/InkscapeConverter")
Then create new instance of Converter
const converter = new InkscapeConverter([1, 2], pngPath, "/opt/local/bin/inkscape"),
And use as param for generating sprites