W3C home > Mailing lists > Public > www-style@w3.org > January 2012

[css3-text] [css4-color] currentColor and inheritance

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 11 Jan 2012 19:22:12 -0800
Message-ID: <4F0E51E4.3080900@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
The problem is that currentColor computes to the value of 'color', and
then inherits as that color. This is fine for non-inheritable properties
like 'border-color', for which it was presumably introduced, but it has
some very strange consequences for 'text-emphasis'.

em { text-emphasis: dot; }
strong { color: red; }

<em>Some black text <strong>some red text</em> ...</em>

In general, it's expected that the dots match the color of the text
they're on. If 'text-emphasis-color' didn't exist, we would certainly
expect this behavior. However, if we introduce it, with the initial
value of 'currentColor', then the dots over the red text are black.
And there is no way to get around this surprising behavior.

We need a keyword that means "the current 'color'", but computes
as specified.

Received on Thursday, 12 January 2012 03:22:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:13 UTC