Re: Gradient syntax proposal

On Tue, Aug 18, 2009 at 11:40 PM, David Perrell<davidp@hpaa.com> wrote:
> Brad Kemper  wrote:
> ---
> background: linear-gradient(-70deg / yellow 52px / blue 52px);
> .
> .
> background: linear-gradient(20px 30px to right 20px bottom 30px / yellow,
> blue);
> ---
>
> Neither example is an easy read - the first could get very difficult with
> many color stops.
>
> At http://hpaa.com/csstest/gradient.htm is an image showing a simple top
> down gradient with mixed lengths and percentages, similar to the gradient I
> gave as an example for considering percentages as applying *between* start,
> end, and <length> positions. The inline image of U.S. Houses of Congress
> would always be near the middle of the text area, whatever the size of the
> text, so positioning the lightest (next-to-last) color stop at 50% of the
> span between the last <length> and the end of the gradient will always
> highlight the image.
>
> This example could be done with two percentage-only gradients. But I still
> think that being able to specify percentages this way opens more
> possibilities while it reduces unwanted effects from mixing. And without
> altering current behavior in cases where position types are all the same.

I just realized that the linked page isn't a good example for this
proposal.  The blue gradient should just be a background on the
heading, and the tan gradient would be a background on the content.
Trying to specify them both in a single image is just *asking* for
awkward display when people resize your text.

~TJ

Received on Wednesday, 19 August 2009 16:36:54 UTC