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

[css3-text] Proposal: specifying text-shadow and color in the same rule

From: Jordan OSETE <jordan.osete@laposte.net>
Date: Mon, 29 Sep 2008 21:30:31 +0200
Message-ID: <48E12CD7.600@laposte.net>
To: www-style@w3.org


The text-shadow property suffers from an important limitation, a 
degradation problem, when you set the text-color to be the same as the 
background color, and set a shadow. The effect can be seen here, in the 
fith and sixth examples ("I, Augustus" and "a cat, an apple, etcetera"):

When "color" and "background-color" are the same, and the author relies 
on a shadow to show to make the text readable, the text becomes 
unreadable on browsers that do not support text-shadow.

In this particular case, a simple solution can solve the problem : being 
able to specify the shadow and the color in the same rule. Let's say the 
acceptable value for text-shadow becomes something like that :
    none | [<color> /] [<shadow>, ] * <shadow>

The following rule :
    text-shadow: black / white 0 0 5px;

Would be equivalent to
    color: black;
    text-shadow: white 0 0 5px;

Thus, either color and shadow are set, or the rule is wholly ignored.

Actually, the same thing has already been proposed long ago in a 
previous mail, that got no reaction :
Though this mail proposed a slightly different syntax (a comma 
separating the color from the shadows instead of a slash), it is the 
same proposal.

Jordan OSETE
Received on Monday, 29 September 2008 19:31:07 UTC

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