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

On Wed, Jun 3, 2015 at 10:45 AM, François REMY <
francois.remy.dev@outlook.com> wrote:

> [2] We had this discussion so many times we should make a meme about it.
> var(...) is replaced by the cascaded value, not the used value, so there is
> no "implicit" dependency between any property at this point. This is
> exactly similar to using a dummy variable to contain your value, except you
> don't have to, which (1) makes your code easier to read, (2) allows you to
> reuse existing css code/libraries. See Lea's email.
>

IIRC, dbaron raised another concern about allowing normal properties to be
used in var(), which is the performance, especially memory usage.

Since var() can be used in any property, we have to store the token
sequence. But for normal properties, the original string is dropped as far
as it is parsed. Storing the token sequence would consume much more memory
than only the parsed value, while it adds very few value to majority of
pages. Even in pages which does need to use some normal properties in
var(), they will only use very limited number of them. The rest stored
tokens will be completely meaningless.

- Xidorn

Received on Tuesday, 2 June 2015 23:00:29 UTC