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

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 UTC