Re: [css3-background] color vs image - final layer

On 29/02/2012 11:44 AM, Tab Atkins Jr. wrote:
> On Tue, Feb 28, 2012 at 3:17 PM, Marat Tanalin | tanalin.com
> <mtanalin@yandex.ru>  wrote:
>> A possible option is to allow rgba() as direct background-image property value -- without redundant image() function-wrapper.
>
> That can't be done without changing 'background' parsing, since the
> first<color>  you see would be ambiguous as to whether it should be
> treated as a background-color or background-image.  You'd have to wait
> until you parsed the entire layer to tell for sure, and this sort of
> thing is generally avoided.  (We do this in list-style, but that was
> probably a mistake.)

This is important point that Tab raises. 'background-color' is painted 
on an infinite canvas, where background-image can be sized (via 
'background-size'), positioned (via 'background-position'), offset (via 
'background-origin') or clipped ('background-clip') in respect to the 
background (and border) of a box.

Allowing a 'background-color' as a final background layer would make the 
combine use of 'background-repeat', 'background-size' and 
'background-origin' disconnected when used with 'background-clip' since 
background-color can only be clipped.

Imagine the below background comma separated string (considering 
semi-transparent borders).

   background: <color>, <image>, <image>;

To change the origin of the 'background-image'(s), I can use this.

background-origin: content-box, padding-box;

But with 'background-clip', I would also have the consider the final 
background layer and have this.

   background-clip: border-box, content-box, padding-box;

All together along with the other properties, we have this.

   background: <color>, <image>, <image>; /* 3 values */
   background-repeat: repeat-y, no-repeat; /* 2 values */
   background-size: auto, 100%; /* 2 values */
   background-origin: content-box, padding-box; /* 2 values */
   background-clip: border-box, content-box, padding-box;  /* 3 values */

> It's unclear whether this is a big enough deal to care about, but I do
> like it for its elegance, particularly since colors are paint servers
> (the analogue of CSS's<image>  type) in SVG.
>
> ~TJ

I like it also. I can imagine this.

   linear-block(rgba(255,127,0,0.5))
   radial-block(rgba(255,127,0,0.5))


BTW, we have a new record for this mailing list. Close to 1400 messages 
for this month.


-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/

Received on Wednesday, 29 February 2012 03:47:39 UTC