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

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 UTC