This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

gulp-iconify-reloaded

0.1.4 • Public • Published

gulp-iconify-reloaded

Gulp-iconify Reloaded is a reboot of the great work put in gulp-iconify.

Planned features

  • Callback for sequential iconify tasks
  • Multiple input/output folders
  • Parallel iconify tasks (gulp 4?)
  • PNG output toggle
  • Multiple color/sizes outputs (mixin helpers)
  • GUI (long term plan)
  • Animated SVG support (long term)
  • Inline SVG output (long term)
  • ... more

This part is still the old readme of 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-reloaded --save-dev

or

yarn add gulp-iconify-reloaded --dev

###Simple example

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

This simple call defaults to the following:

  • SVGs will be passed through SVGO (and optimised)
  • Rendered PNGs will be saved in: './img/icons/png'
  • Rendered SCSS files will NOT be saved
  • Rendered CSS files will be saved in: './css'
  • If SVG has no width attribute, the default fallback will be 300px
  • If SVG has no height attribute, the default fallback will be 200px
  • The default styleTemplate fill be used (examples shown below)
  • The default styleTemplate will not use the height/width slugs
  • See gulp-svg2png for default settings

###Customized example

gulp.task('default', function() {
    iconify({
        src: './img/icons/*.svg',
        pngOutput: './img/icons/png',
        scssOutput: './scss',
        cssOutput:  './css',
        styleTemplate: '_icon_gen.scss.mustache',
        defaultWidth: '300px',
        defaultHeight: '200px',
        svgoOptions: {
            enabled: true,
            options: {
                plugins: [
                    { removeUnknownsAndDefaults: false },
                    { mergePaths: false }
                ]
            }
        },
        svg2pngOptions: {
            scaling: 1.0,
            verbose: true,
            concurrency: null
        }
    });
});

Note: To disable SVGO, just set svgoOptions: { enabled: ___ } to anything but true .

###Example (and default) styleTemplate:

.icon {
    background-repeat: no-repeat;

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

    {{/items}}
}

###Example styleTemplate with height/width slugs:

.icon {
    background-repeat: no-repeat;

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

    {{/items}}
}

Package Sidebar

Install

npm i gulp-iconify-reloaded

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • mathijsrave