W3C home > Mailing lists > Public > www-style@w3.org > February 2009

Re: background-position-x & y

From: Martin Atkins <mart@degeneration.co.uk>
Date: Thu, 05 Feb 2009 13:39:41 -0800
Message-ID: <498B5C9D.6000408@degeneration.co.uk>
To: www-style@w3.org

Faruk AteĊŸ wrote:
> 
> You make a good point; perhaps it would be more useful to have this 
> sprite syntax:
> 
> background-image: sprite(x-start, y-start, x-end, y-end[, url(path)]);
> 
> With the fifth parameter having to be set only once if desired.
> 

I like the functionality this affords, but it seems inconsistent with 
how "shorthands" (which is effectively what this is) work with 
inheritance elsewhere in the language.

Here's another thought:

selector {
     sprite-image: url(some_image);
     background-image: sprite(x1, y1, x2, y2);
}

However, it seems that neither proposal works all that well when there 
are multiple background images, as is allowed in CSS3 Backgrounds and 
Borders. My proposal also suffers when sprite() is used for other 
image-accepting properties such as list-style-image, since it becomes 
impossible to use a separate sprite for each.

(and I think list-style-image is an important use-case, since it seems 
that many times I've used background images to fake list-style-image so 
that I could use the sprite technique.)
Received on Thursday, 5 February 2009 21:40:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:16 GMT