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

Re: Gradient syntax proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 15 Aug 2009 10:39:59 -0500
Message-ID: <dd0fbad0908150839v1201f107ga8d24859fd3ad987@mail.gmail.com>
To: David Perrell <davidp@hpaa.com>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, Brad Kemper <brad.kemper@gmail.com>, www-style list <www-style@w3.org>
On Sat, Aug 15, 2009 at 10:07 AM, David Perrell<davidp@hpaa.com> wrote:
> Andrew Fedoniouk wrote:
> | In short: gradients shall be uniquely addressable.
> Seems reasonable. Besides the issue with remote CSS, it could be frustrating if linear-gradient is not directly modifiable via the DOM.

It's exactly as modifiable as any other CSS property.

> | As I said, there are many cases when you will want to have gradients on
> | boxes other than background box of the element.
> | Think about these cases:
> |
> | background-color: linear-gradient(top to bottom / yellow, blue);
> |
> | border-top-color: yellow;
> | border-left-color: linear-gradient(top to bottom / yellow, blue);
> | border-right-color: linear-gradient(top to bottom / yellow, blue);
> | border-bottom-color: blue;
> |
> | column-rule-color: linear-gradient(top to bottom / yellow, blue);
> I also want to have gradients on text (which is apparently a trivial thing to implement in GDI+). Is that really an unrealistic possibility if gradient is considered a color?

If you want something unambiguous, yes.  Drawing languages have
notions like SVG's "paint server" which can be given to any element's
fill or stroke.  CSS is limited in that direction, because it's not
fundamentally a drawing language, and thus many types of control that
are simple and easy elsewhere are not that easy here.

For example, say you want text to be colored as a gradient.  Is that
on a per-glyph basis, a per-line basis, or a per-element basis?  The
first two don't really have any way to be targetted in CSS.  The
latter is theoretically possible, and Safari currently addresses it
with a proprietary background-clip value.  This is probably the best
way to address this, because the background property is the closest
thing we have to a paint-server consumer.  A similar "border-stroke"
value for background-clip would also address some of the gradient
border requests.

Received on Saturday, 15 August 2009 15:40:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:38 UTC