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

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

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 12 Aug 2009 19:37:58 -0700
To: www-style@w3.org
Message-ID: <20090813023758.GA3355@pickering.dbaron.org>
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 GMT

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