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

Re: Gradient syntax proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 19 Aug 2009 11:35:49 -0500
Message-ID: <dd0fbad0908190935i5ec84190y992afee523687f36@mail.gmail.com>
To: David Perrell <davidp@hpaa.com>
Cc: www-style@w3.org
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 GMT

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