2.2.0 • Published 9 years ago

svgtocss v2.2.0

Weekly downloads
6
License
ISC
Repository
github
Last release
9 years ago

SvgToCSS

Build Status

The idea behind this module came from the work made for aditollo/grunt-svgzr and the probably-dont-base64-svg article

I've decided to separate the URI / base64 svg renderer to generate CSS / SCSS sprites from SVG files.

Usage

var svgtocss = require('svgtocss');

svgtocss.encode(['file1.svg', 'file2.svg'], options, function() {
	console.log('all done!');
})

This task would have created a css file like this

.svg-file1 {
	background-image: url('data:image/svg+xml;charset=utf-8, ...');
}

.svg-file2 {
	background-image: url('data:image/svg+xml;charset=utf-8, ... ');
}

Options

The options parameter can accept these configs:

  • base64: boolean, should compress image in base64? (default: false)
  • cwd: string, the directory to output files (default: './')
  • style: string, css or scss. That changes the output syntax.
  • sprite: string, the file to output. (default: 'svg.css')
2.2.0

9 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.2.0

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.0

10 years ago