-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values-5] Inconsistent argument order between clamp()
and mix()
/progress()
#11427
Comments
You say "arguments renamed for claritity" but the arguments represent completely different things so I don't really think these are comparable situations where consistency would be expected. |
These functions share nothing but one conceptual similarity: They are about one value that sits (or chooses) "between" two bounds, in some way or another. Argument order is always an arbitrary choice anyways... but on a general level, it's easier to remember the more consistent it is, as opposed to being Though arguably CSS' Footnotes
|
I agree for |
...and because of the types being the same, accidentally mixing up the argument order cannot be discovered statically, but only through observed wrong behavior at runtime (I've got bitten by that while first using I'd argue for seeing Due to the prevalence of OOP and it putting the value "being transformed" first (though this also makes sense in functional programming due to currying/partical application), programmers with previous knowledge will probably expect In my opinion, it would have probably been best for
|
The argument order for the newly proposed
progress()
/mix()
functions differs from that of the already existingclamp()
function:From my (limited) viewpoint, this is a potential source of confusion of stylesheet authors. There are good arguments either way (
mix(<lower-bound>, <value>, <upper-bound>)
would be consistent withclamp(<lower-bound>, <value>, <upper-bound>)
, whilemix(<lower-bound>, <min>, <upper-bound>)
would be more symmetric withmix(<value> of <keyframes-name>)
. It would probably make sense to include a note about the inconsistency as well as the rationale for the choice made in the spec to prevent a bit of avoidable confusion in the future.Possibly related: #10489
The text was updated successfully, but these errors were encountered: