Re: Gradient syntax proposal

On Thu, Aug 20, 2009 at 12:47 PM, David Perrell<davidp@hpaa.com> wrote:
> Tab Atkins Jr. wrote:
> | linear-gradient(left / green 30px, wheat 20%, mirror)
>
> The mirror idea sounds good, but I don't like this form. 'Mirror' isn't a color stop. It would make more sense to me if 'mirror' is a keyword in the first part:
>
> linear-gradient(left mirror / green 30px, wheat 40%)
>
> where 'mirror' divides the gradient length in two and percentages refer to half the full length of the gradient (100% = 50% of the gradient length). This would degrade symmetrically.

Alternate idea: mirror-gradient().

Other possibilities: mirrored-gradient(), half-gradient(),
semilinear-gradient(), half-linear-gradient()

Benefit of splitting it out as a new type of gradient is that we can
eliminate parts of the syntax that don't make sense, like the angle
construction, and the second bg-position.  We'd just say that 0% is at
the specified point, and 100% is the center of the box.  Then the
colors get reversed on the far side.

> | > Actually, neither color-stop positioning solution is
> | satisfactory inasmuch as the implicit position of color-stops
> | (subdividing the span between explicit color stops) doesn't jibe
> | with either. A default value is normally one of several
> | specifiable options.
> |
> | Not sure what you're saying here.
>
> First and last color stop positions are specified as 0% and 100% by default. Default position for other color stops is a percentage of the space between stops with specified position. So, I'm thinking of a hierarchy of position types: percent <- relative length <- pixels <- default. Relative lengths refer to spans within specified percentages, pixel lengths to spans within specified percentages or relative lengths, default lengths within any specified lengths.
>
> Make sense?
>
> (BTW, since computed percentages for stops without specified positions are percentages of a span *between stops*, having percentages in general refer to spans between <length> stops is not totally inconsistent.)

All right, makes sense.  Still way too complicated, I think.  ^_^

~TJ

Received on Thursday, 20 August 2009 20:33:15 UTC