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

Re: [css3-background] fallback color on background-image

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Sat, 21 Feb 2009 11:50:34 +0100
Message-ID: <953FA8C716F14EF9B85CE239E404AC11@FREMYCOMPANY>
To: "David Hyatt" <hyatt@apple.com>, "Brad Kemper" <brkemper@comcast.net>, "L. David Baron" <dbaron@dbaron.org>
Cc: "CSS 3 W3C Group" <www-style@w3.org>
Hello everybody,

I think the fallback should not be located in background-color but in background-image.
In fact, the 'new color' is applied as remplacement image, so it's not exactly a background-color. 

* So what about something like that :
===============================

    background-image: url('myImage.png') / rgba(80, 60, 60; 0.5);
    background: transparent url('myImage.png') / rgba(80, 60, 60; 0.5) repeat;

It's more consistent with the rest of the CSS Modules (font-family; ...) where the fallback occurs in the same property than the unavailable ressource.


* Another syntax can be :
===============================

    background-image: (url('myImage.png'), rgba(...));
    background: transparent (url('myImage.png'), rbga(...)) repeat;

It's more consistent with font-family (comma-separated list) but it needs introducting parenthesis to avoid ',' problems in background.


* We also can have :
===============================

    background-image: firstOf(url('myImage.png'), rgba(...));
    background: transparent firstOf(url('myImage.png'), rbga(...)) repeat;    

(This sample is based on a old 'more-general' proposition I did in the CSS WG)
(The proposal was : firstOf(a,b,c) get replaced in the CSSOM by the first value (a, b or c) that's accepted by the UA for the considerated property)

Regards,
Fremy
Received on Saturday, 21 February 2009 10:51:12 GMT

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