Gaya / Retina-Sprites-for-Compass

Allow to use sprites in retina with Compass.
160 stars 31 forks source link

Pass $icon-spacing variable #5

Closed jbates closed 10 years ago

jbates commented 10 years ago

I need some spacing in my sprite map for when users zoom in a browser. Is there any way to pass a $-spacing variable in?

Thanks!

jbates commented 10 years ago

I've tried some things that aren't working, mostly documented here. But it should work, so... researching. https://github.com/chriseppstein/compass/issues/934

Gaya commented 10 years ago

Hi, just did a quick search and found out spacing doesn't work with layout: smart;. If you remove that option it should work like explained in the issue you are referring to.

jbates commented 10 years ago

Thank you, Gaya. I was just coming back here to update. The use of the spacing variable has changed recently and there's some threads out there complaining about how the Compass docs are unclear as to whether the $spacing variable needs prefixing or not, and whether or not spacing is fixed (or should be fixed) for use with $layout: smart.

I tried a bunch of things and this works--no prefixing on the $spacing variable, and smart layout with spacing still doesn't work:

$icons: sprite-map("icons/*.png", $spacing: 20px);
$icons-2x: sprite-map("icons-2x/*.png", $spacing: 20px);

Your mixin continues to rock. Thanks again.

Gaya commented 10 years ago

Awesome. Thanks for the clarification. Closing this thread now.