Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

sprite with smart layout not support sprite-spacing? #718

Open doabit opened 12 years ago

doabit commented 12 years ago

When i use sprite-layout with smart, sprite-spacing not work, does it not support sprite-spacing with smart layout?

$icon-spacing: 5px !default; $icon-layout:"smart";

doabit commented 12 years ago

I found http://beta.compass-style.org/help/tutorials/spriting/sprite-layouts/ and it shows not support configuration options

scottdavis commented 12 years ago

Correct this is a limitation of smart layout

Sent from my iPhone

On Feb 14, 2012, at 9:34 AM, doabitreply@reply.github.com wrote:

When i use sprite-layout with smart, sprite-spacing not work, does it not support sprite-spacing with smart layout?

$icon-spacing: 5px !default; $icon-layout:"smart";


Reply to this email directly or view it on GitHub: https://github.com/chriseppstein/compass/issues/718

afewyards commented 11 years ago

why is this a limitation.. I find myself over and over again trying to get around some bugs because this isn't here.

scottdavis commented 11 years ago

because of the packing algorithm. If you want to use spacing use horizontal or vertical.

afewyards commented 11 years ago

figured that it had something to do with the algorithm.. thing is that when you use the other ones it uses a larger PNG file if you want to fit in all those assets into it.. and when it exceeds 1024px the iPad < retina will not cache those files.. so you need to split up way quicker..

afewyards commented 11 years ago

can you otherwise point me in the direction where the algoritm is stored and used so I can take a look. thanks.

scottdavis commented 11 years ago

https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/sprites/layout_methods.rb#L84-L98

https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/sprites/row_fitter.rb

afewyards commented 11 years ago

thanks you!

estahn commented 11 years ago

Any progress here? The issue we have is with zoom level in different browsers. It will show a part of the other image if there is no spacing.

evangelion1204 commented 11 years ago

We too have the same problem with zooming and mobile devices that interpolate sprites on Android devices. Android devices doesn't support images bigger than 4096px and start scaling them down to bad quality. Because of that it is not possible to use a big sprite in responsive designs.

Raibaz commented 11 years ago

Same problem here, been looking into the smart layout to use the sprite on an iPad < retina, but i need to have the images spaced inside the sprite...any progress on this?

chriseppstein commented 11 years ago

We should implement this feature.

afewyards commented 11 years ago

worked on it for a bit.. but no result yet unfortunately..

evangelion1204 commented 11 years ago

Well I got a working solution for me but I never wasted a thought that the spacing changes from sprite to sprite, thats something I didn't need until now. But I don't really have an idea how to contribute to the project, need to read the FAQ for that first

ArekBartnik commented 11 years ago

Could someone explain why this is a limitation of smart layout but not horizontal or vertical?

afewyards commented 11 years ago

^^ scottdavis wrote: "because of the packing algorithm. If you want to use spacing use horizontal or vertical."

materliu commented 11 years ago

yeah, we truly nead the spacing fun when we use smart sprite

piouPiouM commented 11 years ago

One suggestion: you should only use smart layout with elements having the dimensions of the images to display (and a display: block for example). This will prevent any overflow. If this is not possible with some elements, then store them in a vertical sprite.

In addition, instead of loading a huge sprite will have a significant weight maybe split it in multiple sprites? Of course, this requires additional HTTP requests, but you already save many using sprites.

therazor commented 9 years ago

There seems to be a patch, but the feature is not working as of v 1.0.3. Is it still unmerged?

jo32 commented 9 years ago

http://stackoverflow.com/questions/16793278/generate-sprites-with-compass-with-smart-layout-and-spacing

Somebody has already patch it for us. Maybe it is time to add this feature?

borys-p commented 8 years ago

How about a global spacing for all sprites in one map? This should be much easier to implement. It's been almost four years since the first report and this issue is still open...