W3C home > Mailing lists > Public > www-style@w3.org > November 2010

Re: [css3-background] New use case for background-position-x (&y!)

From: Jonas Hartmann <j0n4s.h4rtm4nn@googlemail.com>
Date: Mon, 8 Nov 2010 15:48:59 +0100
Cc: Lee Kowalkowski <lee.kowalkowski@googlemail.com>, www-style@w3.org
Message-Id: <3AD7669E-8112-49B4-AC06-570D57EB3881@googlemail.com>
To: fantasai <fantasai.lists@inkedblade.net>

what do you consider the hackish nature of css background image sprites?
The often happening html markup's pollution with class attributes?

On 2010-11-08, at 12:15, fantasai wrote:

> On 11/08/2010 01:36 AM, Lee Kowalkowski wrote:
>> Hi,
>> No idea if this is too late for the spec, I only just realised I
>> wanted this.  Hopefully it will pick up browser support regardless.
>> My use case has arisen from a card game I'm currently writing.  I
>> decided to put all my playing cards into 1 graphic, x position defines
>> rank, y position defines the suit, like a static CSS sprite.
>> I give my playing card elements class names like "diamonds rank-10", I
>> want to apply background-y depending on suit and background-x
>> depending on rank, using _different_ class names.
>> If I could do this, I'd only need to define 17 rules in my CSS file,
>> instead of a rule for all 52 cards (I've already done this, I just
>> think the 17 rules would look a lot better).
> All the use cases I've seen so far are improved hacks for image
> sprites. Which is something I think should be addressed directly,
> not by making such hacks easier. IMO.
> ~fantasai
Received on Monday, 8 November 2010 14:49:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:40 UTC