Re: [csswg-drafts] [css-values-4] Should progress() functions clamp to 0-100%? (#11825)

| Author wants to clamp | If `progress()` clamps | If `progress()` doesn't clamp |
| - | - | - |
| Yes | `progress(value, start, end)` | `clamp(0, progress(value, start, end), 1)` |
| No | `calc((value - start) / (end - start))` | `progress(value, start, end)` |

Regardless of whether it clamps or not, the other case will be more obnoxious to write.
Still, adding `clamp(0, _, 1)` seems easier to me than doing the math manually (which requires writing `start` twice, and could be a long expression).
But of course if >90% of the cases want to clamp, it's better to clamp.

Or we could cover both behaviors with 2 functions, or change the behavior with an optional parameter

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11825#issuecomment-2964366720 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 11 June 2025 21:42:38 UTC