jkphl / grunt-iconizr

SVG + PNG icon kit generator — Grunt plugin wrapping around node-iconizr that creates a CSS icon kit from a bunch of SVG files, serving them as SVG / PNG sprites or embedded data URIs along with suitable CSS / Sass / LESS / Stylus etc. stylesheet resources and a JavaScript loader for easy integration into your HTML documents
http://iconizr.com
MIT License
104 stars 9 forks source link

Choosing what css to output #18

Closed dawidvdh closed 9 years ago

dawidvdh commented 10 years ago

Hi Great Plugin! Just two questions:

I have created a custom template which works beautifully. But it still outputs 4 stylesheets, my custom one and then 3 others, Is there anyway for it to only output my custom template and non of the others?

Then Also, if i set it to output to 'liveload/img' it creates an additional folder called 'icon', is there any way to not create the additional folder?

Here is my current configuration:

iconizr: {
            options: {
                // Task-specific options go here.
                dims    : true,
                common: 'img',
                recursive: true,
                render    : {
                    css     : false,
                    scss    : {
                        template    : 'config/sprite.hbs',
                        dest        : '../../compass/source/_icons.scss'
                    }

                },
                variables   : {
                    png: function() {
                        return function(sprite, render) {
                            return render(sprite).split('.svg').join('.png');
                        }
                    }
                }
            },
            bsWatch: {
                src         : ['iconizr/source'],
                dest        : 'liveload',
            }
        }

i am using bsWatch task currently.

Any Help would be Greatly Appreciated.

jkphl commented 9 years ago

Hi @dawidvdh,

first of all sorry for not getting back to you earlier — and Happy New Year! :)

I'm not sure if I fully understand your question(s), but I'll try:

  1. It's iconizr's ultimate sense to always output several stylesheet resources in parallel. Please read the node-iconizr introduction to get an idea of why and what they're good for. Using the JavaScript loader resource, your client (browser) will choose which one fits him best. You wouldn't want to get rid of them.
  2. Is it possible that the directory created is named icons (instead of icon)? I guess this must be the spritedir option. Please set it to "." to avoid that directory.

I'll close this issue for now, but please feel free to re-open it if you've still got problems.

Cheers, Joschi