W3C home > Mailing lists > Public > www-style@w3.org > April 1998

text-shadow's limited utility (& an alternative)

From: Garth Wallace <gwalla@hotmail.com>
Date: Mon, 20 Apr 1998 20:39:44 PDT
Message-ID: <19980421033945.18604.qmail@hotmail.com>
To: www-style@w3.org
It seems to me that the current CSS2 text-shadow property is not an 
ideal solution for two reasons:

 1) It is something of a misnomer. If anything, it should be named 
font-shadow. At least, according to the naming conventions used so far, 
text- properties tend to have less to do with the style of type than 
with character-level concerns such as case. In terms of traditional 
typography, changes to font- properties would require using a different 
font, while changes to the text- properties would involve the selection 
of specific characters (for example, uppercase characters) and 
additional decorations (adding underlines, strike-throughs, and the 
like) (text-decoration: blink is an aberration, unless you think of the 
decoration as being applied in the fourth dimension. This may be pushing 

 2) It is very limited. It can only be used for text shadow effects, and 
of these it can only do drop shadows. Cast shadows are still impossible 
without resorting to images.

My proposed solution is a font-effect property, used to apply any 
graphical "special effect" to text. The format of the font-effect 
property would be:

  font-effect: effect depth angle size color blur transparency

The effect option would determine the type of effect applied. The values 
would be mutually exclusive and would include:
  none   - regular text
  drop   - a drop shadow
  cast   - a shadow cast in the perceived x-z plane
  inset  - a bevelled effect similar to the eponymous border-style
  outset - a bevelled effect, the inverse of inset
  inherit - default, already defined in CSS(2)

I will refer to drop and cast collectivey as "shadow" effects, and inset 
and outset as "bevel" effects.

All remaining options would be meaningful in the context of shadows. 
Only depth and angle might possibly have an effect in the context of 
bevels. The remkaining options may be listed more than once in the 
context of shadows to produce multiple-shadow effects.

The value of the depth option would be a size specified in any of the 
font size formats (pt, em, etc.). In drop shadows, it refers to the 
perceived distance along the z-axis from the main character to the 
shadow. In cast shadows, it refers to the distance from the lowest point 
(baseline or descender) of each character to the imaginary x-z plane on 
which that character's shadow lies. If it affects bevel effects at all, 
it refers to the depth of the bevel. If a percentage value is specified, 
the depth is calculated from the current font size once, and the 
resulting absolute depth is inherited.

The value of the angle option is a number from -360 to 360 inclusive. It 
specifies the angle of the shadow's projection clockwise from 3:00.

The value of the size option is a font size type. It refers to the font 
size of drop shadows and the length of cast shadows. If a percentage is 
used, it is inherited uncalculated, and the absolute shadow size is 
recalculated for each change in font-size.

Color is the color of the shadow.

Blur is the blur radius of the shadow, specified in the same way as the 
blur value for the current text-shadow proposal.

Transparency is the transparency of the shadow and takes a number from 0 
to 100. 0 is opaque, while 100 is completely transparent. Intermediate 
values lend color and shade to elements underneath by varying amounts.

I'm not entirely happy with this proposed property. It may take too many 
values. However, it provides much more functionality than the 
text-shadow property and is more extensible.

------------ "I am not a number! I am a free man!" ---------------
                                        - The Prisoner*
*or a USC student       <gwalla@planetall.com>

Get Your Private, Free Email at http://www.hotmail.com
Received on Monday, 20 April 1998 23:39:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:47 UTC