Re: CSS variable syntax

On Thu, Apr 3, 2014 at 1:42 PM, Matthew Robb <matthewwrobb@gmail.com> wrote:
> Will I be able to reference non custom properties with var()?
>
> var(background-color)
>
> Cause this would be amazing and more consistent.

No.  Unfortunately, that causes all kinds of mischief, since some
properties depend on the values of other properties.  We manually keep
the language from having circular dependencies (sometimes with
difficulty), but letting people link arbitrary properties together
would wreck that.

One might object that we already handle circular dependencies in
custom properties, since they *can* refer to each other.  The
difference is that the links between custom properties are all
explicit, and under the control of the author.  The links between
built-in properties are implicit and sometimes hard to see, and we add
new connections regularly.  Code that might have had valid
dependencies previously might suddenly become circular after we update
the way a property behaves, which isn't acceptable for the language.

~TJ

Received on Thursday, 3 April 2014 20:49:11 UTC