Re: [css-variables] Why we can not use 'var()' function for normal property

On Tue, Jun 2, 2015 at 9:27 AM, Marat Tanalin <mtanalin@yandex.ru> wrote:
> 02.06.2015, 19:19, "Tab Atkins Jr." <jackalmage@gmail.com>:
>> On Wed, May 13, 2015 at 6:37 AM, BangSeongbeom <bangseongbeom@hotmail.com> wrote:
>>>  'var()' function is limited for custom property only.
>>>  Custom properties and normal properties should be treated equally.
>>
>> Because of cycles.
>
> Instead of fearing cycles at all, we could just limit nesting/recursion level for `var()`, so that once some reasonable limit (e.g. 10) is achieved, applying styles referenced by corresponding nested `var()` calls is just stopped.

That doesn't help at all; there's no "recursion".  CSS is declarative,
not imperative; there's no defined evaluation order.  In an example
like "--one: var(--two); --two: var(--one);", neither declaration is
evaluated "first".  Both are applied at the same time, and thus cyclic
references are *not* like infinite loops in JS; they're actually
*meaningless*.

~TJ

Received on Tuesday, 2 June 2015 16:45:29 UTC