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

[css3-images] design of gradients and use of functions in CSS in general.

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Fri, 12 Aug 2011 00:09:45 -0700
Message-ID: <BLU165-ds1843D3A45E5D6371B0ECDEF8250@phx.gbl>
To: <www-style@w3.org>
Looking on discussions around gradients in CSS I came up to conclusion that 
so high volume
of issues and flames about it now will never lead to something solid in 
[nearest] future.

Problems as I see them:

1. Chosen notation (function alike) is non-flexible and not adequate to the 
task of
   defining such complex and multi-variant entity.
2. linear-gradient() covers only small subset of useful gradient cases. 
radial-gradient()
   is in better shape but still not complete.

If we will accept the spec in the way it is written now we will probably 
solve some
basic use cases but will create solution that will not be extendable in 
future due to
#1 - bad, non-extendable notation.

Style definition as a collection of name/value pairs is "future-reliable" as 
we can extend
set of properties without changing others. And gradient definition should 
use something
like this as it is actually also a collection of orthogonal properties that 
define bunch of
different color distribution functions.

I would suggest to consider functions with named arguments in CSS, something 
like this:

    gradient( type:linear,
                    color-stops: red yellow green,
                    from: top left );

This will allow to define what we want at the moment and to extend gradients 
in future.

In fact gradients are not the only things that require such extended 
function notation.
Various layout methods - values of 'flex-flow' are better to be definable as 
such
functions. Each flow may have its own and specific set of sub-properties - 
it
is better to do not pollute main style properties name space. We are 
actually very
close to the limit of meaningful names - we have at multiple properties with
**-rows and **-columns names.  They cannot be applied at the same time -
so they better to be sub-properties:

    flow: columns( column-widths: ... ; ruler: ... )
    flow: template( 1 2, 4 3 );
    flow: horizontal(dir:rtl);

and so on.

Brad did tremendous job with css3-images spec. We now better understand the
problem. But means of implementation of the idea are not adequate.


-- 
Andrew Fedoniouk

http://terrainformatica.com 
Received on Friday, 12 August 2011 07:10:15 GMT

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