Re: [css-variables] var() for non-custom properties

I absolutely agree with Lea.

Good product (be it a spec or software or anything else) is a product that constantly evolves according to needs of its audience.

The whole process of developing W3C specs sometimes looks like "they have let the inmates run the asylum" (quote from Alan Cooper).



23.05.2015, 06:19, "Lea Verou" <lea@verou.me>:
> Letting implementation complexity leak into the UI is a common antipattern and this is exactly what’s happening here.
>
> I never quite understood why functions like element() [1] can just brush this off with “The element() function can produce nonsensical circular relationships, such as an element using itself as its own background. These relationships can be easily and reliably detected and resolved, however, by keeping track of a dependency graph and using common cycle-detection algorithms.”
>
> *ALL* cycles can be detected by “keeping track of a dependency graph and using common cycle-detection algorithms”. Worst case scenario, we can just be very aggressive about what depends on what and it’s still better than rejecting entire features that are needed by thousands of authors daily on the grounds of “but if used nonsensically it could result in a cycle and then the world would explode!!!11”.
>
> Not to mention that using variables, besides being an ugly solution, is not an option when you want to reference CSS you do not control.
>
> Potential cycles come up all the time with any reasonable styling mechanism that supports the kinds of constraints needed by real designs. Maybe it’s time to devise a way of dealing with them when they actually occur or at least have a real chance of occurring.
>
> The ripple effects of avoiding cycles like the plague accounts for most of the utter puzzlement people feel when dealing with CSS even in their first few lines of CSS code. I’m sure we can do better.
>
> ~Lea
>
> [1]: http://dev.w3.org/csswg/css-images-4/#element-notation
>
> Lea Verou ✿ http://lea.verou.me ✿ @leaverou
>>  On May 22, 2015, at 12:16, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>
>>  On Fri, May 22, 2015 at 7:21 AM, François REMY
>>  <francois.remy.dev@outlook.com> wrote:
>>>>  Is there some reason that var() can not be used for non-custom properties?
>>>  It depends. If you want to use the computed value of a property, you'll be
>>>  out of luck, because that would create inadvertent cycles.

Received on Saturday, 23 May 2015 19:26:48 UTC