W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

Re: [csswg-drafts] Resolve values of attr() functions in a custom property

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Tue, 24 Jul 2018 18:19:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-407503636-1532456362-sysbot+gh@w3.org>
No, there's nothing bad perf-wise. It can't be done because it's a significant behavior change, and violates the consistent expectations that you can put anything into a custom property and it'll arrive, unchanged, at its destination when you finally substitute it into a real property.  The sole exception to that rule is `var()` functions, for necessary reasons, and I'm not willing to carve out more exceptions. Whatever benefit they may bring in one case is more than counter-balanced by the usefulness in *other* cases of them not being eagerly resolved, plus the loss of a consistent mental model for working with custom properties.

After all, why is `attr()` special? Why not any other function? `var()` has a reason to be special - building up composite variables from base variables is a core use-case - and even then, there's good use-cases for it to act the same as everything else and be "late-binding", substituted only at point-of-use further down the tree.

Like I said, I have a plan to address this in a **generic** fashion in the future. But I'm not going to change behavior that's been shipped for years at this point for a one-off special-case.

GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2946#issuecomment-407503636 using your GitHub account
Received on Tuesday, 24 July 2018 18:19:25 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:33 UTC