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

Re: [css-variables] Resolving fallback-enabled cyclical property references

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Wed, 24 Oct 2012 09:08:31 +0200
Message-ID: <24BF62FB64AA493E9D77728F8553A4E1@FREMYD2>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "CSS WG" <www-style@w3.org>
|  I'm fine with making something like this work, but I question the
|  usefulness.  Cycles in your variables aren't an intentional feature;
|  they're an authoring error, and I define cycle detection just as an
|  error recovery mechanism.

They are authoring error if you have no fallback. If you have one, I don't 
think it's an authoring error.

The pattern [[ get(a || fallback), get(b) ]] is useful to link the value of 
two properties on certain DOM nodes only.

* {
    color: get(my-text-color || inherit);

:root {
    my-link-color: blue;

:link {
    my-link-color: get(my-text-color || get(parent my-link-color));
    my-text-color: get(my-link-color);

.withRedText {
    my-text-color: red; // also changes my-link-color when applied on a link
Received on Wednesday, 24 October 2012 07:08:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:22 UTC