Skip to content

Commit 66a3197

Browse files
committed
[css-values-4] Clarify in the prose that min/max/round also need all their calcs to be the same type. #7496
1 parent 627d38b commit 66a3197

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

css-values-4/Overview.bs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,6 +2888,12 @@ Comparison Functions: ''min()'', ''max()'', and ''clamp()''</h3>
28882888
(That is, given ''clamp(MIN, VAL, MAX)'',
28892889
it represents exactly the same value as ''max(MIN, min(VAL, MAX))'').
28902890

2891+
For all three functions,
2892+
the argument [=calculations=] can resolve to any <<number>>, <<dimension>>, or <<percentage>>,
2893+
but must have the <em>same</em> [=determine the type of a calculation|type=],
2894+
or else the function is invalid;
2895+
the result will have the same [=CSSNumericValue/type=] as the arguments.
2896+
28912897
<div class="example">
28922898

28932899
''min()'', ''max()'', and ''clamp()'' can be used to make sure a value doesn't exceed a "safe" limit:
@@ -3916,7 +3922,8 @@ Type Checking</h3>
39163922

39173923
* The [=CSSNumericValue/type=] of a ''calc()'' or ''abs()'' expression
39183924
is the [=CSSNumericValue/type=] of its contained [=calculation=].
3919-
* The [=CSSNumericValue/type=] of a ''min()'', ''max()'', or ''clamp()'' expression
3925+
* The [=CSSNumericValue/type=] of a
3926+
''min()'', ''max()'', ''clamp()'', ''hypot()'', ''round()'', ''mod()'', or ''rem()'' expression
39203927
is the result of [=add two types|adding the types=]
39213928
of its comma-separated [=calculations=].
39223929
* The [=CSSNumericValue/type=] of a ''sign()'' expression
@@ -3927,9 +3934,6 @@ Type Checking</h3>
39273934
is «[ "angle" → 1 ]».
39283935
* The [=CSSNumericValue/type=] of a ''pow()'', ''sqrt()'', ''log()'', or ''exp()'' expression
39293936
is «[ "number" → 1 ]».
3930-
* The [=CSSNumericValue/type=] of a ''hypot()'', ''round()'', ''mod()'', or ''rem()'' expression
3931-
is the result of [=add two types|adding the types=]
3932-
of its comma-separated [=calculations=].
39333937

39343938
For each of the above,
39353939
if the [=CSSNumericValue/type=] is failure,

0 commit comments

Comments
 (0)