W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [css-variables] using variables in shorthands

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 19 Mar 2012 17:44:39 -0700
Message-ID: <CAAWBYDCe+hoAxfw=AC4jFBZjZNr6EMEVZBEBN_VRuECj8uZ8Dw@mail.gmail.com>
To: Mike Sherov <mike.sherov@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sat, Mar 17, 2012 at 8:45 AM, Mike Sherov <mike.sherov@gmail.com> wrote:
> Forgive me if I'm misunderstanding the problem, but this question
> sounds like its similar to what getComputedStyle and "resolved value"
> does.

Unfortunately, you are misunderstanding the problem. ;_;

The issue is that shorthands expand into their longhands at
specified-value time (before inheritance occurs).  However, data
properties inherit, and so we can't expand variables until after
inheritance.  If you have an unexpanded variable in a shorthand, you
have *no idea* how to expand it into a shorthand until you expand the
variable.  The ordering is thus mixed up.

I think Shane has the right of it, though, with his idea.  We can just
define that shorthands expand into a special form for their longhands
that doesn't require information about what the variable will finally
expand into.  It's not very *useful*, but it does what needs to be
done with a minimum of changes to normal operation.

~TJ
Received on Tuesday, 20 March 2012 00:45:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:52 GMT