Re: Warnings with valid background-color

On Thu, 13 Oct 2005, Matt LaPlante wrote:

> According to CSS 1 & 2 specs, transparent is a valid background-color
> attribute,

It is (modulo the definition of "valid"), and it is even the initial 
value, or "default" in a certain sense.

> so I see no reason it should generate a warning.

Setting both content color and background color to white is surely 
"valid", but it should probably generate a warning.

> I read the FAQ
> regarding background-color, and I'm assuming it wants me to specify a color
> rather than allow transparency.

Yes.

> I think this is logically flawed;

Maybe, but the flaw is in the CSS specifications, not in the warning.
The cascade principles imply that by setting color to something specific 
and setting or defaulting background-color to transparent, you make
your text appear in that color against a background whose color you cannot 
reliably predict, even assuming that user and browser style sheets have 
been written consistently. When people fail to understand this, the reason 
is almost always insufficient (or maybe completely wrong) understanding of 
the cascade. (A typical symptom is to confuse cascade with inheritance.)

> obviously
> if the designer has taken the trouble to specify transparency explicitly,
> they intend to allow the lower level color to support the color: attribute.

They do, but it is part of the cascading principles that the lower level 
colors (background color and text color, or even just one of them in a 
poorly designed style sheet) can be determined by another style sheet, 
which the author cannot control or even see.

CSS would be much easier without the "C" part, and a little less useful.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Friday, 14 October 2005 06:31:26 UTC