Reputation:
Both CSS functions clamp the value between an upper and lower bound.
The only difference that I know is that minmax() can only be used in CSS grid.
Upvotes: 3
Views: 5599
Reputation: 1877
minmax() may only be used in Grid and picks between two (2) parameters.
clamp() can be used anywhere in CSS and picks between three (3) parameters: minimum, preferred, and maximum, selecting the middle (preferred) parameter when possible.
Upvotes: 8
Reputation: 5767
From developer.mozilla.org:
clamp()
enables selecting a middle value within a range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value.
minmax()
only accepts the two extreme values, plus the difference that you already mentioned.
Upvotes: 2