0.0.8 • Published 10 years ago

svg2css v0.0.8

Weekly downloads
10
License
MIT
Repository
github
Last release
10 years ago

svg2css

Read SVGs from a directory, creates sprites of each svg with color variations specified in a separated JSON file, and generates a simple CSS file.

Installation

Install the module with npm:

npm install svg2css

Configuration

  • dataUris Type: Boolean. Default: false

    Generate CSS file with base64 SVGs as data URIs

  • spriteCellWidth Type: Number. Default: 520

    The width of each sprite cell

  • spriteCellHeight Type: Number. Default: 520

    The height of each sprite cell

  • svgPath Type: String. Default: 'svg/'

    Input folder of SVGs

  • outputPath Type: Sring Default: 'output/'

    Output folder for SVGs

  • cssPath Type: String. Default: 'output/svg'

    Path for the generated stylesheet

  • colorFile Type: String. Default: 'colors.js' Path to the JSON file where read the color information for color conversion. The path is relative to svgPath.

Usage

var svg2css = new SVG2CSS({
    svgPath: 'example/svg/',
    outputPath: 'example/output/',
    cssPath: 'example/output/css/',
    colorFile: 'colors.json' // relative to svgPath
});

See example/run.js for more info.

License

MIT

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago