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

Re: [css-variables] Referencing all properties (Issue 4, !important)

From: Pete Boere <pete@the-echoplex.net>
Date: Fri, 14 Sep 2012 09:44:32 +0100
Message-ID: <CAKZZz6fXqWPBsXp_eGUNdsDrSRFs8XLsr9J7ezr1pQc_oi3pqw@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Fran├žois REMY <fremycompany_pub@yahoo.fr>, CSS WG <www-style@w3.org>
>Trying to reference the value of other properties on the current
element is a non-starter, right off the bat.

In preprocessors there is some use to this, even if a bit dumb as it's not
a computed value just in context of the code block as written. The oddest
aspect is preventing the circular references, which in reality makes the
feature slightly farcical [1]


> Property references to the element's parent
*might* be possible, and there's nothing messing with that right now.

Quite useful in preprocessors, though, obviously not in the [css-variables]
way [2]

.foo {
    width: 40em;
    height: 100em;
}

.bar {
    width: query( .foo ); /* 40em */
    margin-top: query( .foo, height ); /* 100em */
    margin-right: query( .foo, top, auto ); /* auto */
    margin-bottom: query( .foo, default, 3em ); /* 3em */
}



[1] https://github.com/peteboere/css-crush/wiki/Functions#wiki-this
[2] https://github.com/peteboere/css-crush/wiki/Functions#wiki-query
Received on Friday, 14 September 2012 08:45:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:00 GMT