W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

Re: [csswg-drafts] [css-variables][css-cascade] When are variables computed?

From: Chris Harvey via GitHub <sysbot+gh@w3.org>
Date: Mon, 18 Jun 2018 19:51:40 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-398174269-1529351499-sysbot+gh@w3.org>
@tabatkins Thanks for your explanation. It sounds like when people say “custom properties are inherited” what they really mean is “child elements inherit the computed value of custom properties” (as opposed to the declared value).

Do you recommend another mechanism that does what I’m trying to achieve? I have functional colors set (text, background, emphasis, etc.) on the application level, and then within the application I have containers of varying themes (American, Irish, etc.). Then elements within all the themed containers have the actual css properties set. In other words, what I’m thinking is:

> “On the application level, set the Text Color to Base Color, no matter what that is or what it will be in the future (Base Color could be determined by a theme later on). Then elements can use Text Color on any css property they want.”

Last question… You said that the reason the paragraph color was black was that since `color` was invalid at computed time, it takes the initial value. But in my CodePen, when I add `figure { color: purple; }`, the `p` is made purple instead of black. Is this because the initial value of `color` is `currentColor`, or is it because `color` an inherited property and the invalid value is actually defaulting to inherit instead of initial?

GitHub Notification of comment by chharvey
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2793#issuecomment-398174269 using your GitHub account
Received on Monday, 18 June 2018 19:51:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 18 June 2018 19:51:43 UTC