Re: [csswg-drafts] [css-values] Make min and max value optional in `clamp()` (#9713)

> @ByteEater-pl The idea is that `min()` and `max()` can be confusing, e.g. someone wants a calculation like `var(--a) * var(--b) + var(--c)` but enforcing a minimum of 0px. If they are thinking in terms of adding a minimum threshold they might be tempted to use `min()`, but actually they need `max()`.
> 
> But I'm not sure if this proposal will really help much, people who misunderstands what `min()` does will probably use it anyway, and people aware of this "gotcha" can just use `max()` indeed.

Not necessarily. They might remember there is some weirdness around this, and this frees them from having to do the mental gymnastics. Or they may just reach for `clamp()` without considering `min()` or `max()` because they have internalized that that's what you use to introduce upper and lower bounds, and you use `min()` and `max()` when you need the minimum or maximum number among many. These are distinct use cases, and I'd argue using `min()` or `max()` for the former is actually a workaround, not a primary use case for `min()` and `max()`.

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


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

Received on Friday, 5 January 2024 23:28:26 UTC