Skip to content

Commit e20824b

Browse files
committed
[css-values] Serialize % before px in calc example
The example ''calc(20px + 0%)'' is serialized as ''calc(0% + 20px)'', according to the serialize a summation rules https://drafts.csswg.org/css-values/#math-function-serialize-a-summation i.e. Sort the terms in the following order: 1. The number, if present 2. The percentage, if present 3. The dimensions, ordered by their units <a>ASCII case-insensitive</a> alphabetically 4. The ''min()'' and ''max()'' functions, in the order they appeared in the original expression.
1 parent 0350ef3 commit e20824b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

css-values-4/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ Serialization</h4>
24422442
For example, ''calc(20px + 30px)'' would serialize as ''calc(50px)'' as a specified value,
24432443
or as ''50px'' as a computed value.
24442444

2445-
A value like ''calc(20px + 0%)'' would serialize as ''calc(20px + 0%)'',
2445+
A value like ''calc(20px + 0%)'' would serialize as ''calc(0% + 20px)'',
24462446
maintaining both terms in the serialized value.
24472447
(It's important to maintain zero-valued terms,
24482448
so the ''calc()'' doesn't suddenly "change shape" in the middle of a transition

0 commit comments

Comments
 (0)