Skip to content

'A mystical CSS icon solution', grunticon-like build system.

License

Notifications You must be signed in to change notification settings

graincreative/gulp-iconify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-iconify

'A mystical CSS icon solution', grunticon-like build system for Gulp:

'grunticon is a Grunt.js gulp-iconify is a gulp task that makes it easy to manage icons and background images for all devices, preferring HD (retina) SVG icons but also provides fallback support for standard definition browsers, and old browsers alike. From a CSS perspective, it's easy to use, as it generates a class referencing each icon, and doesn't use CSS sprites.'

##Usage

npm install gulp-iconify --save-dev

###Simple example

gulp.task('default', function() {
    iconify({
        src: './img/icons/*.svg'
    });
});

This simple call defaults to the following:

  • Rendered PNGs will be saved in: './img/icons/png'
  • Rendered SCSS files will NOT be saved
  • Rendered CSS files will be saved in: './css'
  • The default styleTemplate fill be used (see below)

###Customized example

gulp.task('default', function() {
    iconify({
        src: './img/icons/*.svg',
        pngOutput: './img/icons/png',
        scssOutput: './scss',
        cssOutput:  './css',
        styleTemplate: '_icon_gen.scss.mustache'
    });
});

###Example (and default) styleTemplate:

.icon {
    background-repeat: no-repeat;

    {{#items}}
    &.icon-{{slug}} {
        background-image: url('{{{datauri}}}');
    }

    {{/items}}
}

About

'A mystical CSS icon solution', grunticon-like build system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.1%
  • HTML 1.9%