Re: Gradient syntax proposal

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.

~TJ

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