Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Each task run, SVG's are duplicated into main sprite #20

Closed
ghost opened this issue Aug 29, 2014 · 7 comments
Closed

Each task run, SVG's are duplicated into main sprite #20

ghost opened this issue Aug 29, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented Aug 29, 2014

I'm not sure if this is intended or part of the plugin, but each time I run the task the SVG's get put into the sprite causing duplicates. So before each run I have to delete the sprite.svg, then run the task again to ensure I have no duplicates.

Is there an option I'm missing or is this the way to use the plugin?

Also can you define padding as two values for example:

padding: 0 10

The intended result would be no padding top/bottom but 10 left/right

@jkphl
Copy link
Collaborator

jkphl commented Aug 29, 2014

Hi @mrshannonyoung,

thanks for your report. I must admit I'm quite irritated as you are the first person ever having this problem — so I must assume that there's some kind of misconfiguration. Could you please provide your Grunt task showing how you configured svg-sprite?

And no, there's no way of specifying a twofold padding at the moment. Why would you want this? Padding in general does no harm (except maybe some very few wasted bytes in the PNG versions of the sprite), so why not have it on all sides (if at all)?

Cheers,
Joschi

@ghost
Copy link
Author

ghost commented Aug 29, 2014

Hi Joschi, thanks for your response. Here is the Grunt configuration as requested.

svgsprite : {
  spriteSass : {
  src: ['path/to/svg'],
  dest: 'path/to/root',
    options: {
      render: {
        css: false,
        scss : {
          dest: 'sass/partials/_sprite'
        }
      },
      spritedir: 'assets/',
      layout: 'horizontal',
      padding: 0,
      keep: false,
      dims: true,
      recursive: true,
      verbose: 3,
    }
  }
},

My padding questions were just a general wondering. You mentioned PNG versions, how do you get it to generate a PNG version along-side the SVG?

Thanks for your time.

@jkphl
Copy link
Collaborator

jkphl commented Aug 29, 2014

Hi @mrshannonyoung,

thanks! I'm just about leaving my office and heading to the UK, will be in Brighton over the next week, so I'll probably not have the chance to work on your issue. Thanks for your patience.

About the PNG: When I wrote this, I didn't think of the package you were posting your issue for, sorry. svg-sprite iteself doesn't support PNG fallbacks. But if you're interested in this, then you should check out my grunt-iconizr package which is built upon svg-sprite and does exactly this.

Cheers,
Joschi

@ghost
Copy link
Author

ghost commented Aug 29, 2014

Hi Joschi, Brighton is a wonderful city they have the famous Responsive Conference Hosted by Jeremy Keith at Brighton Dome every year and the amazing Street Diner which you should definately check out if you can.

Ah, I will check out grunt-iconizr.

Have fun.

@jkphl
Copy link
Collaborator

jkphl commented Aug 29, 2014

Hi @mrshannonyoung,

exactly this is why I'm going there! ;) John's Reasons to be creative, Jeremy's dConstruct and the IndieWebCamp UK afterwards. A looooong week of conferences.

Cheers,
JOschi

@ghost
Copy link
Author

ghost commented Aug 29, 2014

Nice! I went to dConstruct in 2013, this years line up looks great.

Take care.

@jkphl
Copy link
Collaborator

jkphl commented Dec 29, 2014

Hi @mrshannonyoung,

I just published the next major release of grunt-svg-sprite. It's rewritten from scratch and now featuring an enhanced padding option — could you please check this? Also, could you please check if you still get that duplicate shape problem? I'm pretty confident that this one is gone now as well ...

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

Cheers & a happy new year,
Joschi

@jkphl jkphl closed this as completed Dec 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant