grunt-iconizr icon indicating copy to clipboard operation
grunt-iconizr copied to clipboard

Possibility of a 'packed' layout option?

Open benfrain opened this issue 10 years ago • 7 comments

Wondered if it would be difficult/worthwhile to provide a 'packed' layout option alongside the others?

Whereby each image just take the available space alongside the other images (creating the smallest/most compact image sprite).

benfrain avatar May 20 '14 16:05 benfrain

Hey @benfrain,

I'm not sure if I understand your question correctly. Are you talking about a sprite where the images are stacked horizontally and vertically at the same time?

Thanks, Joschi

jkphl avatar May 26 '14 21:05 jkphl

Hi Joschi, yes, the so they create the smallest possible size (in dimensions terms) image sprite. It's not a big deal but useful in some circumstances (although I don't have any numbers I actually wonder whether the UA would find it easier to shift around too).

Ben On 26 May 2014, at 22:27, Joschi Kuphal [email protected] wrote:

Hey @benfrain,

I'm not sure if I understand your question correctly. Are you talking about a sprite where the images are stacked horizontally and vertically at the same time?

Thanks, Joschi

— Reply to this email directly or view it on GitHub.

benfrain avatar May 26 '14 21:05 benfrain

So you suggest this from a file size (and possibly performance) point of view? Well, it would definitely be possible to provide such an option. On the other hand, I'm not sure it would be used that often, as you must not have any padding around the icon within the surrounding element in that case. Anyway, I'll consider adding it as soon as I find the time — why not?! ;)

Cheers, Joschi

jkphl avatar May 26 '14 21:05 jkphl

Hi Joschi,

The only thing making me think that performance might (also might not – not tested) be slightly improved with a 'packed' layout is this info from the Compass documentation:

http://compass-style.org/help/tutorials/spriting/sprite-layouts/

Note, they refer to 'packed' as a 'smart' layout - exactly the same thing and as you can see in their example, padding around a sprite is fine.

Does that clarify?

Best, Ben On 26 May 2014, at 22:44, Joschi Kuphal [email protected] wrote:

So you suggest this from a file size (and possibly performance) point of view? Well, it would definitely be possible to provide such an option. On the other hand, I'm not sure it would be used that often, as you must not have any padding around the icon within the surrounding element in that case. Anyway, I'll consider adding it as soon as I find the time — why not?! ;)

Cheers, Joschi

— Reply to this email directly or view it on GitHub.

benfrain avatar May 26 '14 21:05 benfrain

:+1: for packed layout. It definitely looks and works as smart layout :)

niksy avatar Nov 01 '14 12:11 niksy

Hi @benfrain & @niksy,

just wanted to let you know that support for a packed sprite layout is finally on it's way! I released a rewritten version of svg-sprite a couple of days ago, which is the base of iconizr and does support the packed layout now. I'll start rewriting iconizr from scratch in the next couple of days, so just stay tuned ...

Besides that, Happy New Year! :)

Cheers, Joschi

jkphl avatar Jan 02 '15 15:01 jkphl

Oh wow, that’s a great start for new year! :D Happy New Year, too!

niksy avatar Jan 03 '15 08:01 niksy