W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: fallback color for background-image (ISSUE-5)

From: Brad Kemper <brkemper@comcast.net>
Date: Fri, 4 Apr 2008 19:29:49 -0700
Message-Id: <D02FA7C3-4F7B-4FC6-9244-5136DEF94A08@comcast.net>
To: fantasai <fantasai.lists@inkedblade.net>, Alan Gresley <alan@css-class.com>, Anne van Kesteren <annevk@opera.com>, "www-style@w3.org List" <www-style@w3.org>


On Apr 4, 2008, at 6:57 PM, Brad Kemper wrote:

>
>
> On Apr 4, 2008, at 10:22 AM, fantasai wrote:
>
>>
>> Brad Kemper wrote:
>>> There might be other styles you would want to change if the image  
>>> did not load, besides just background-color. Maybe we need a ":  
>>> resources-not-loaded" pseudo-class that could be applied to any  
>>> element, class, etc., which would provide fallback properties  
>>> when that element contained external resources that did not load  
>>> (for whatever reason).
>>
>> I think that's getting a little too generic. Most of the time
>> if decorative images don't load it's not a big deal. For
>> backgrounds it's a readability issue, though.
>>
>> The other important one that needs fallbacks is 'content', we're
>> handling that by making it take a comma-separated list of values.
>>
>>   content: url(hello.png), "hello";
>>
>> I guess you could argue that distinguishing between the cases where
>> this results in a replaced element (using hello.png) vs. where it's
>> just text ("hello") would be useful.
>>
>> ~fantasai
>>
>
> I think you misunderstood me a little. I am still talking about  
> cases where images, svg, and the like (perhaps even external style  
> sheets) don't load, especially when they are used for backgrounds  
> and content (the most common use case anyway) for but where other  
> properties are set with expectation that they are available. So,  
> for instance:
>
> #myElement {
> 	background: url(black_shape_with_writing.png) transparent no-repeat;
> 	color: white;
> 	font-size:18px;
> 	content: content;
> 	}
> #myElement:not-loaded {
> 	background-color: black;
> 	color:yellow;
> 	font-size:10px;
> 	content: "not loaded yet";
> }
>

So the main difference with the way I have it is that if, for  
instance, a background fails to load, that can be mitigated using any  
number of properties. It wouldn't limit you to just using other  
background properties (just because they happen to be part of the  
background shorthand) in order to rectify the situation.
Received on Saturday, 5 April 2008 02:30:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:04 GMT