SmartSprites

Spacing between graphics in sprites

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 0.3.0
  • Component/s: None
  • Labels:
    None

Description

Original Patrik's description

It need to be possible to add spacing between the graphics in sprites. This is so that sprites can be used as background images in elements highter than or wider than the individual graphics.

Brief analysis

There seems to be a general pattern emerging from this task: multi-level defaults for certain properties of sprites and individual images. More description below. The three levels on which the properties can be defined are:

  1. Global level, applies to all sprite images and their individual images
  2. Sprite image level, applies to all individual images in the sprite
  3. Individual image level, applies to the individual image only

Higher level values can be overridden on lower levels. Properties affected could include:

  • sprite-margin-*

TODO: complete specification of this ticket, change the titile.

Activity

Hide
Stanisław Osiński added a comment -

Hi Patrik,

Would sprite margins (sprite-margin-left, sprite-margin-right, sprite-margin-top, sprite-margin-bottom) do the trick for you?

Cheers,

S.

Show
Stanisław Osiński added a comment - Hi Patrik, Would sprite margins (sprite-margin-left, sprite-margin-right, sprite-margin-top, sprite-margin-bottom) do the trick for you? Cheers, S.
Hide
Patrik Grinsvall added a comment -

Hi Stanisław,

sprite-margin-left, sprite-margin-right, sprite-margin-top, sprite-margin-bottom is basically what I want. However I was unable to get this to work properly with the auto-generated background-position. The sprite itself is however spaced according to the margins.

As long as the background-position is generated correctly setting the spacing with sprite-margin-* is fine but it would be really nice to be able to set this in one place on a per sprite basis. This so that it can be changed in one place in case the spacing needs to be increased/decreased.

Regards
Patrik

Show
Patrik Grinsvall added a comment - Hi Stanisław, sprite-margin-left, sprite-margin-right, sprite-margin-top, sprite-margin-bottom is basically what I want. However I was unable to get this to work properly with the auto-generated background-position. The sprite itself is however spaced according to the margins. As long as the background-position is generated correctly setting the spacing with sprite-margin-* is fine but it would be really nice to be able to set this in one place on a per sprite basis. This so that it can be changed in one place in case the spacing needs to be increased/decreased. Regards Patrik
Hide
Stanisław Osiński added a comment -

You're right Patrik, a similar pattern (see description) could probably be applied to other properties as well.

Show
Stanisław Osiński added a comment - You're right Patrik, a similar pattern (see description) could probably be applied to other properties as well.
Hide
Stanisław Osiński added a comment -
Show
Stanisław Osiński added a comment - Yet another use case for this feature mentioned on the discussion group: http://groups.google.com/group/smartsprites-css-sprite-generator/browse_thread/thread/36fc50ec0246da40?hl=en_US#
Hide
Stanisław Osiński added a comment -

Partial implementation, including inheritance of sprite-align and sprite-margin-* properties from the sprite image directive implemented and available from:

http://download.csssprites.org/smartsprites-0.2.7-dev.zip

Show
Stanisław Osiński added a comment - Partial implementation, including inheritance of sprite-align and sprite-margin-* properties from the sprite image directive implemented and available from: http://download.csssprites.org/smartsprites-0.2.7-dev.zip

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0h
Remaining Estimate - 0h
Logged:
2.75h
Time Spent - 2.75h