jakearchibald / sprite-cow

Sprite Cow helps you get the background-position, width and height of sprites within a spritesheet as a nice bit of copyable css.
http://www.spritecow.com
Other
1.3k stars 129 forks source link

percentage based positioning #31

Closed EdwinToh closed 12 years ago

EdwinToh commented 12 years ago

would be cool to have percentage based positioning instead of pixels.

jakearchibald commented 12 years ago

Out of curiosity, what's the use-case?

EdwinToh commented 12 years ago

Hmm.. for responsive/retina/non-retina sprites, using percentages is better than pixels.

jakearchibald commented 12 years ago

Interesting, I still use pixels in this case, & do background-image: url('img/sprites@2x.png'); background-size: 512px auto; for retina devices.

EdwinToh commented 12 years ago

Ah okay. I never knew there was that method! :) If that works then I guess it is not necessary!

jakearchibald commented 12 years ago

I'm going to keep this open, the % thing might be handy if you're not bg-sizing everything down to the same size. Will have more of a think about it. Thanks for suggesting!

rodolfocaldeira commented 12 years ago

This feature would be definitely very useful for creating responsive sprites using the background-size property. See this article for more details.

Love Sprite Cow !!!!

jakearchibald commented 12 years ago

Added this (you may have to refresh the page a couple of times for appcache to show the changes)

rodolfocaldeira commented 12 years ago

Good stuff !!! Thank you for that Jake.