Re: [csswg-drafts] [css-values] Add clamp()?

What if the minimum value `m` is greater than the maximum one `M`? I can see various possibilities:

| m | v | M | min(M, max(m, v)) | max(m, min(M, v)) | v<m ? m : (M<v ? M : v) | v>M ? M : (m>v ? m : v) |
|---|---|---|------|---|---|---|
| 3 | 0 | 1 |    1 | 3 | 3 | 3 |
| 3 | 2 | 1 |    1 | 3 | 3 | 1 |
| 3 | 4 | 1 |    1 | 3 | 1 | 1 |

Or maybe `m` and `M` should just be swapped if the former is greater. https://github.com/w3c/csswg-drafts/issues/544#issuecomment-321498156 also proposes choosing the one of `m` or `M` which is closer to `v`, but then what to do if they are equally close?


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

Received on Monday, 16 April 2018 14:15:50 UTC