Re: Gradient syntax proposal

Brad Kemper wrote:
>
> On Aug 14, 2009, at 6:38 AM, "Tab Atkins Jr." <jackalmage@gmail.com> 
> wrote:
>
>> On Thu, Aug 13, 2009 at 10:59 PM, Andrew
>> Fedoniouk<news@terrainformatica.com> wrote:
>>> Drawing in CSS uses two layers for background drawing: color layer
>>> and image layer on top of it. So is my question.
>>
>> The layers are irrelevant.  Conceptually and realistically colors are
>> substantially different from images.  You have no control over colors
>> beyond just specifying them - they fill whatever you're doing.  A
>> gradient is an image.
>
> We did earier discuss the idea of using gradients as a type of color, 
> so it could be used anywhere color values are used. But we decided 
> against, because there were just too many places where it wouldn't work.
>
I see no problems with having (yet another) function that define color. 
Now we have rgb(...) and I see no problems with having linear-gradient() 
as such a color.

Rules are simple:
1) if color function by its nature defines more than one color then it 
is applicable only if it defines color of background of some *box* (e.g. 
element background, one of element borders, etc.).
2) each such a color function should have 'default' atomic color value: 
e.g. start  of gradient.
3) if color function is applied to the property that designates color of 
the stroke, e.g. [text-]color then used value is that default value of 
the function.

Having this we can define things like:

background-color: linear-gradient(...);
border-left-color: linear-gradient( top bottom, ... );
border-right-color: linear-gradient( top bottom, ... );
border-right-color: linear-gradient( top bottom, ... );
column-rule-color: linear-gradient( top bottom, ... );
etc.

So color property accepts color function that defines distribution of 
colors in some box.
Therefore single color value like #FFAFFF is just color function named  
solid-color(#FFAFFF).

And reading Tab's proposal it is not clear how to redefine solid color 
for some element.
    div { background: linear-gradient(...); }  
    div.solid { ??? what should be here to remove gradient ??? }

--
Andrew Fedoniouk.

http://terrainfromatica.com

Received on Friday, 14 August 2009 21:45:03 UTC