W3C home > Mailing lists > Public > www-style@w3.org > February 2008

RE: [css3-text] Multiple Text Shadow Stacking Order

From: Paul Nelson (ATC) <paulnel@winse.microsoft.com>
Date: Fri, 8 Feb 2008 04:34:23 -0800
To: Alan Gresley <alan1@azzurum.com>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <D92F7E6A79E88B4684BFC067AE15477D159E0D33D1@NA-EXMSG-S702.segroup.winse.corp.microsoft.com>

Conversely, the background could be changed to render from bottom to the top.

Either way is fine with me as long as we are consistent.

>From an implementer's point of view it is easier to draw the list from beginning to end from bottom to top. That way I don't have to find out how many objects are in the list and paint from the end of the list to the beginning.

Say you have four colors in a list; Red, Green, Yellow and Blue.
Funny results when asking my wife what she expected.
1. if they were stacked on top of each my wife expected Red to be on top
2. if they were offset she expected to see the following color on top of the previous one.

I guess herein lies the problem.


From: Alan Gresley [alan1@azzurum.com]
Sent: Friday, February 08, 2008 8:23 PM
To: Paul Nelson (ATC)
Cc: www-style@w3.org
Subject: RE: [css3-text] Multiple Text Shadow Stacking Order

Paul Nelson wrote in reply to fantasai:

>> The text-shadow definition in CSS2 specifies that the first shadow
>> effect is on the bottom and the last one on top. This is inconsistent
>> with how multiple backgrounds work. Should we change it?
> Shadows are painted from back to front.
> http://www.w3.org/TR/CSS21/visuren.html#propdef-z-index
> > Boxes with the same stack level in a stacking context are stacked back-to-front according to document
> tree order.

Agree totally.

> The definitions seem to be consistent. Can you provide an example for your point?
> Paul

What Fantasai is asking is if it would be better to have the same order that each multiple text shadow is called as each multiple background image is called in comma separated strings like:

div {
  background: url(a.png) 0 0%, url(b.png) 100% 0, url(c.png) 100% 100%; /* top to bottom */
  text-shadow: 10px 10px 0 red,  19px 90px 0 blue,  100px 60px 0 yellow; /* top to bottom */

An author would find it easier (and more intuitive) to change text-shadow "red" and background "url(a.png)" since they both would occur first. In the specs for multiple backgrounds we have "The first image in the list is the layer closest to the user, the next one is painted behind the first." Text shadow should have the same order.


Received on Friday, 8 February 2008 12:34:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC