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: Mon, 7 Apr 2008 07:43:49 -0700
Cc: www-style@w3.org
Message-Id: <776727D9-27E7-4B77-AA6D-385629427299@comcast.net>
To: Patrick Garies <pgaries@fastmail.us>


On Apr 6, 2008, at 1:21 AM, Patrick Garies wrote:

> Patrick Garies wrote:
>> There’s really no need to hijack another specification. Just  
>> define a
>> new at‐rule:
>>
>> h1 { background: transparent url("image.png"); } @missing
>> resource("image.png") { /* missing is a synonym for disabled,
>> blocked, unsupported, malformed, inaccessible, incomplete, etc.
>> resources */ h1 { background-color: black; } }
>>
>> Another Potential Scenario:
>>
>> <object type="image/png" data="image.png"> <p>This is a sentence.</p>
>> <p>This is a sentence.</p> </object>
>>
>> object { display: block; margin: 1em; background: crimson; } @missing
>> resource("image.png") { object { background: transparent; }
>> object::before { content: "Fall‐Back Content:"; display: block;
>> color: red; font-weight: bolder; } }
>>
>> — Patrick Garies
>
> I guess that I should note that I chose the format @missing  
> resource("string") over something like @missing "string" since the  
> former can be extended. For example:
>
> @missing namespaces("http://www.w3.org/1999/xhtml")
> @missing media-types("text/javascript", "text/ecmascript",  
> "application/javascript", "application/ecmascript")
> @missing declarations("color", "currentColor", forestgreen)
> @missing values("currentColor", "color", "background-color")
> @missing values(string, "text-align");
> @missing properties("opacity", "-moz-opacity")
> @missing at-rule("namespace")
>
> — Patrick Garies
>

That syntax seems is fine with me. I'm not real clear on how the other  
variants woud work, but they look interesting and useful.
Received on Monday, 7 April 2008 14:44:37 GMT

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