W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2016

[csswg-drafts] [css-ui] Computed value of currentColor

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Mon, 21 Nov 2016 01:11:03 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-190598337-1479690662-sysbot+gh@w3.org>
frivoal has just created a new issue for 

== [css-ui] Computed value of currentColor ==
[css-ui-3 defines the computed value of caret-color this 

> The computed value for auto is auto. For <color> values, the 
computed value is as defined for the [CSS3COLOR] color property.

The intent was (among other things) to have `currentColor` compute to 
`currentColor` as a keyword, but it is not clear if this wording is 
good to unambiguously define it that way.

 we're told that:
> The used value of the ‘currentColor’ keyword is the computed value 
of the ‘color’ property. If the ‘currentColor’ keyword is set on the 
‘color’ property itself, it is treated as ‘color: inherit’. 

The first sentence says that `currentColor` is resolved at used value 
time, which implies that it stays as a keyword at computed value time.
 “treated as” in the second sentence implies that at computed value 
time on the `color` property, `currentColor` has been replaced with 
the computed value of the `color` property on the parent element.

Despite the fact that CSS-UI invokes the computed value logic of the 
color property, it wouldn't make much sense for `currentColor` on 
`caret-color` to “be treated as inherit”, but it would be possible to 
read it as `currentColor` being replaced by an actual color value at 
computed value time. Given that `caret-color` is an inherited 
property, this would lead to a different (undesirable) behavior than 
preserving it as a keyword at computed value time.

[css-color-4 also 
agrees](https://drafts.csswg.org/css-color/#currentcolor-color). It 
says the following about currentColor:
> if the value is inherited, it’s inherited as currentcolor, not as 
the value of the color property, so descendants will use their own 
color property to resolve it.

Since the intended meaning in css-ui-3 and the meaning inferred by 
color-4 agree: `currentColor` should computed to `currentColor` as a 
keyword. I suggest making this unambiguous in css-ui-3 by changing the
 Computed Value entry in the propdef table to:

> The computed value for auto is auto, and for currentColor is 
currentColor. For other <color> values, the computed value is as 
defined for the color property. 

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/741 using your GitHub 
Received on Monday, 21 November 2016 01:11:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:05 UTC