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

On Thursday 2009-08-13 13:54 +1200, Robert O'Callahan wrote:
> On Thu, Aug 13, 2009 at 10:40 AM, fantasai <fantasai.lists@inkedblade.net>wrote:
> >  fantasai: I think the syntax is very verbose. Is it verbose because
> >            we need room for extensions, or is it verbose because no
> >            one's bothered to simplify it yet
> 
> 
> How should we simplify the syntax? I think we improved the syntax a bit in
> our implementation but I'm not sure how to make it much better.
> 
> The simplest possible case is a horizontal or vertical linear gradient. In
> our syntax:
> background: linear-gradient(0 0, 100% 0, from(red), to(green));

Or, since the first two parts accept any of the values that
background-position takes, this could also be written as:

  background: -moz-linear-gradient(left, right, from(red), to(green));

just as a horizontal rainbow could be written as:

  background: -moz-linear-gradient(left, right, from(red),
                                                color-stop(16%, orange),
                                                color-stop(32%, yellow),
                                                color-stop(48%, green),
                                                color-stop(60%, blue),
                                                color-stop(76%, indigo),
                                                to(violet));


The one thing I might do to simplify the syntax would be to disallow
floats inside color-stop() and require that the stop positions be
given as percentages.  (Right now color-stop(0.6, blue) is the same
as color-stop(60%, blue).)

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Thursday, 13 August 2009 02:38:37 UTC