W3C home > Mailing lists > Public > www-archive@w3.org > August 2009

Re: [CSSWG] Minutes and Resolutions 2009-08-12

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Thu, 13 Aug 2009 20:14:11 +0000
Message-ID: <CE0D169C87ED49D9BC2D22BC43794E0E@FREMYCOMPANY>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, <robert@ocallahan.org>
Cc: "Brad Kemper" <brad.kemper@gmail.com>, "fantasai" <fantasai.lists@inkedblade.net>, <www-style@w3.org>
BTW, I had thought <gradient> would be a possible value for <image>. 
Why do we now need for additional 'gradient' property ? By adding 
<gradient> as a possible <image> value, we could simply use background
whithout requiring any change in the CSS 'background' property.

<gradient> would be a flexible image that 'streches' the zone where
the image is drawn. It's maybe the only thing that's different with
a normal image (because that image would have a defined size).


From: François REMY 
Sent: Thursday, August 13, 2009 9:53 PM
To: Tab Atkins Jr. ; robert@ocallahan.org 
Cc: Brad Kemper ; fantasai ; www-style@w3.org 
Subject: Re: [CSSWG] Minutes and Resolutions 2009-08-12


From: "Tab Atkins Jr." <jackalmage@gmail.com>
> On Thu, Aug 13, 2009 at 3:08 AM, Robert O'Callahan<robert@ocallahan.org> wrote:
>> That seems far more complicated than what we currently have. By writing it
>> as a 'gradient' rule you don't benefit background-clip, background-position,
>> background-repeat, multiple backgrounds, and falling back to a background
>> image. It's not extensible to other kinds of gradients, and doesn't handle
>> repeating gradients. And even so,
> 
> Agreed - it should stay as a functional notation denoting an image
> that just happens to be constructed by the browser.
> 
> As to the actual syntax:
> 
> I think the major loss of the current syntax is the functional
> notation of the colors.  It's a large gain in complexity, increases
> the chance of an accidental mistake, and gains us nearly nothing from
> what I can tell.
> 
> The vast majority of gradients will, I believe, be simple 2-color
> fades.  As such, requiring someone to write "from(white),to(black)" is
> almost criminal when they could just write "white,black" or even
> "white black".

+1

> More complex gradients are also overcomplexified.  The vast majority
> of complex gradients will be simple n-color fades, going from one to
> the next in turn.  Again, it's criminal to then make someone write
> "from(white),color-stop(50%,orange),to(black)" when they could just
> say "white orange black".

What do you think of a syntax like :

    gradient: <gradienttype> [<gradientcolors>]?

        <gradienttype> : <linear> | <radial> | <square> | ...
        <linear> : linear\(<point>,(<point> | <angle>)\) 
                // The first point is 'from' and second is 'to', if the second argument is an angle
        <radial> : radial\(<point>,<point>\) 
                // First point is 'center of the radial' and second is a point of the 100% circle
        ...

        <point> : (top | bottom)? <length>? (left | right)? <length>? 
                            // top left is by default;top 10% right 5% is the point 
                            located at 10% of the top and 5% of the end of the gradient image
        <lenght> : Or should it be <percentage> ?
    
        <gradientcolors> : <color>, [<length> <color>, ]* <color> 
                            // First is always at 0%, last at 100%

Sample :

    gradient: radial(left, right) white, 50% #ddd, black;

Would produce :



Sample :
    
    gradient: linear(top left, bottom right) white, black;

Would produce :

    A simple linear diagonal gradient from white to black;

Sample :

    gradient: linear(left 50%, right) black, white;

Would produce :




Regards,
François






B8.bmp
(image/bmp attachment: B8.bmp)

B9.bmp
(image/bmp attachment: B9.bmp)

Received on Friday, 21 August 2009 08:41:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:18:26 GMT