svg-sprite / grunt-svg-sprite

SVG sprites & stacks galore — Grunt plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours

Home Page:https://github.com/svg-sprite/svg-sprite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error: path must be a string when setting css mode options

daltonridenhour opened this issue · comments

I'm getting "Fatal error: path must be a string" when I add any additional options to the css mode:

mode            : {
     css         : {     // Activate the «css» mode
         render  : {
              css : true,
              layout : 'horizontal'
         }
    }
}

Any ideas? Thanks!

Hi @daltonridenhour,

that one is easy: the layout option is one level too deep. Make it a sibling of render and you should be fine:

mode            : {
     css         : {     // Activate the «css» mode
         layout : 'horizontal'
         render  : {
              css : true,

         }
    }
}

Works for you?

Cheers,
Joschi

Ah! Misread the docs. Thanks! This is a great plugin.

Glad you like it, thanks! 👍

Actually, while you are here, is there a way to apply only padding-bottom to the icons in a horizontal layout? I want to be able to pad the icons and still use background-size: cover to make them completely fill the container dimensions.

Should be possible with shape.spacing.padding: [0, 0, x, 0] (off the top of my head).