Closed Richienb closed 7 months ago
We'll copy the order for the css function of the same name https://developer.mozilla.org/en-US/docs/web/css/clamp
https://github.com/Richienb/proposal-math-clamp/pull/3#discussion_r1455444602
The parameter order in the draft JavaScript version is (value, min, max), whereas the CSS version is (min, value, max), which is quite confusing.
The CSS version's prioritization of the minimum value is based on accessibility needs in CSS practices. However, this behavior might not be easily mapped to general-purpose programming languages, as pointed out in this pull request. It seems to be quite inconsistent with the behavior of other programming languages.
We're using (number, min, max) because this is how most userland implementations order them.
Should the number be the first argument and the range be the next two or should the range be the first and third with the number in the middle?