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

Re: [csswg-drafts] [css-values-4] How to interpolate min/max/clamp? (#4082)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Thu, 04 Jul 2019 16:21:25 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-508532182-1562257284-sysbot+gh@w3.org>
@AmeliaBR So if you want to interpolate function parameters instead of function results, does it meant that the half point between `pow(2, 2) = 4` and `pow(2, 4) = 16` would be `pow(2, 3) = 8` and not `(4+16)/2 = 10`? And the half point between `tan(0turn) = 0` and `tan(0.5turn) = 0` would be `tan(0.25turn) = infinity`? Or would `min/max/clamp` be special in this regard?

IMO this kind of things seem nice for simple cases but can get complicated and very inconsistent. So while I do think it's a valid usecase, maybe it would be better to do it using custom props. I believe this is supposed to work if `--param` is registered as a `<length-percentage>`:
```css
#el {
  transition: --param 1s;
  --param: 0%;
  width: min(5em, var(-param));
}
#el:hover {
  --param: 100%;
}

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4082#issuecomment-508532182 using your GitHub account
Received on Thursday, 4 July 2019 16:21:27 UTC

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