https://github.com/raiseandfall/broccoli-cssmyicons
Broccoli plugin to generate a CSS for SVG icons
https://github.com/raiseandfall/broccoli-cssmyicons
broccoli broccoli-plugin css-icon svg-icons
Last synced: 7 months ago
JSON representation
Broccoli plugin to generate a CSS for SVG icons
- Host: GitHub
- URL: https://github.com/raiseandfall/broccoli-cssmyicons
- Owner: raiseandfall
- License: mit
- Created: 2015-06-24T19:54:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T12:46:50.000Z (almost 9 years ago)
- Last Synced: 2025-10-09T01:18:50.136Z (8 months ago)
- Topics: broccoli, broccoli-plugin, css-icon, svg-icons
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/broccoli-cssmyicons
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CSS my icons
[](https://travis-ci.org/raiseandfall/broccoli-cssmyicons) [](https://www.npmjs.com/package/broccoli-cssmyicons)
> Broccoli plugin to generate a CSS file for SVG icons used as background-image:
```css
.icon-home{background-image:url('icons/home.svg');background:no-repeat;}
```
> There are also versions for [Grunt](https://github.com/raiseandfall/grunt-cssmyicons) and [Gulp](https://github.com/raiseandfall/gulp-cssmyicons)
## [CHANGELOG](./CHANGELOG.md)
## INSTALL
```shell
$ npm install broccoli-cssmyicons
```
## USAGE
```javascript
var cssMyIcons = require('broccoli-cssmyicons');
var tree = cssMyIcons(app, {
files: ['*.svg'],
dest: 'icons.css',
destDir: 'assets/style',
prefixPath: '/'
});
```
## OPTIONS
### cssMyIcons(tree, options)
#### options.files
Type: `Array`
_Required_
This option is the glob of the svg folders.
#### options.dest
Type: `String`
_Optional_
**Default** style.css
Path to the CSS file to export to.
#### options.destDir
Type: `String`
_Optional_
Destination directory to export the CSS file to.
#### options.prefixPath
Type: `String`
_Optional_
Prefix to add at the beginning of the icons path
## CONTRIBUTE
```shell
$ npm run test
```
## LICENSE
MIT