Skip to content

Commit 9697e73

Browse files
darrnshntabatkins
authored andcommitted
Add example of normalizing N-ary operators (#532)
1 parent 1c6dbb4 commit 9697e73

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

css-typed-om/Overview.bs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,6 +2568,33 @@ CSS <<number>>, <<percentage>>, and <<dimension>> values become {{CSSNumericValu
25682568
</pre>
25692569
</div>
25702570

2571+
<div class=example>
2572+
Note that addition and multiplication are N-ary,
2573+
so ''calc(1px + 2px + 3px)''
2574+
produces the structure:
2575+
2576+
<pre>
2577+
CSSMathSum(
2578+
CSS.px(1),
2579+
CSS.px(2),
2580+
CSS.px(3)
2581+
)
2582+
</pre>
2583+
2584+
but ''calc(calc(1px + 2px) + 3px)''
2585+
produces the structure:
2586+
2587+
<pre>
2588+
CSSMathSum(
2589+
CSSMathSum(
2590+
CSS.px(1),
2591+
CSS.px(2)
2592+
),
2593+
CSS.px(3)
2594+
)
2595+
</pre>
2596+
</div>
2597+
25712598
Note: The value computation process may transform different units into identical ones,
25722599
simplifying the resulting expression.
25732600
For example, ''calc(1px + 2em)'' as a specified value

0 commit comments

Comments
 (0)