Skip to content

Commit 1024dc3

Browse files
committed
[css-values] Add note callign out the fact that unitless-0 doesn't work in calc().
1 parent 53830b6 commit 1024dc3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

css-values/Overview.bs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,13 @@ Type Checking</h4>
16691669
(''cm'' is <<length>>, ''deg'' is <<angle>>, etc.).
16701670
An ''attr()'' expression's type is given by its <<type-or-unit>> argument.
16711671

1672+
Note: Because <<number-token>>s are always interpreted as <<number>>s or <<integer>>s,
1673+
"unitless 0" <<length>>s or <<angle>>s aren't supported in ''calc()''.
1674+
That is, ''width: calc(0 + 5px);'' is invalid,
1675+
even though both ''width: 0;''
1676+
and ''width: 5px;''
1677+
are valid.
1678+
16721679
If percentages are accepted in the context in which the expression is placed,
16731680
a <<percentage-token>> has the type of the value that percentages are relative to.
16741681
For example, in the 'width' property, percentages have the <<length>> type,

0 commit comments

Comments
 (0)