Skip to content

[css-values] Serialize % before px in calc example#3333

Merged
tabatkins merged 1 commit into
w3c:masterfrom
ewilligers:calc-serialization-example
Nov 20, 2018
Merged

[css-values] Serialize % before px in calc example#3333
tabatkins merged 1 commit into
w3c:masterfrom
ewilligers:calc-serialization-example

Conversation

@ewilligers
Copy link
Copy Markdown
Contributor

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.

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.
@ewilligers ewilligers added the css-values-4 Current Work label Nov 19, 2018
@tabatkins tabatkins merged commit 9a6c7b7 into w3c:master Nov 20, 2018
@ewilligers ewilligers deleted the calc-serialization-example branch November 20, 2018 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css-values-4 Current Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants