Skip to content

Commit 57bb2c6

Browse files
committed
[css-values] Consistently separate <number> (the type) from 'number' (the literal syntax) for integer/number/percentage/dimension. This makes calc()/etc nesting actually work.
1 parent d34d737 commit 57bb2c6

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

css-values/Overview.bs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,9 @@ Numeric Data Types</h2>
614614
Integers: the <<integer>> type</h3>
615615

616616
Integer values are denoted by <dfn id="integer-value">&lt;integer></dfn>.
617-
An <dfn>integer</dfn> is one or more decimal digits ''0'' through ''9''
617+
618+
When written literally,
619+
an <dfn export>integer</dfn> is one or more decimal digits ''0'' through ''9''
618620
and corresponds to a subset of the <<number-token>> production
619621
in the CSS Syntax Module [[!CSS3SYN]].
620622
The first digit of an integer may be immediately preceded by ''-'' or ''+''
@@ -633,8 +635,11 @@ Integers: the <<integer>> type</h3>
633635
<h3 id="numbers">
634636
Real Numbers: the <<number>> type</h3>
635637

636-
Number values are denoted by <dfn id="number-value">&lt;number></dfn>.
637-
A <dfn>number</dfn> is either an <<integer>>
638+
Number values are denoted by <dfn id="number-value">&lt;number></dfn>,
639+
and represent real numbers, possibly with a fractional component.
640+
641+
When written literally,
642+
a <dfn export>number</dfn> is either an <a>integer</a>,
638643
or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits
639644
and optionally an exponent composed of "e" or "E" and an integer.
640645
It corresponds to the <<number-token>> production
@@ -655,9 +660,11 @@ Real Numbers: the <<number>> type</h3>
655660
<h3 id="percentages">
656661
Percentages: the <<percentage>> type</h3>
657662

658-
A <dfn>percentage</dfn> value is denoted by
659-
<dfn id="percentage-value">&lt;percentage></dfn>,
660-
and consists of a <<number>>
663+
Percentage values are denoted by <dfn id="percentage-value">&lt;percentage></dfn>,
664+
and indicates a value that is some fraction of another reference value.
665+
666+
When written literally,
667+
a <dfn export>percentage</dfn> consists of a <a>number</a>
661668
immediately followed by a percent sign ''%''.
662669
It corresponds to the <<percentage-token>> production
663670
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
@@ -711,14 +718,18 @@ Percentages: the <<percentage>> type</h3>
711718
<h3 id='dimensions'>
712719
Numbers with Units: <a>dimensions</a></h3>
713720

721+
The general term "dimension" refers to a number with a unit attached to it,
722+
and are denoted by <dfn>&lt;dimension></dfn>.
714723

715-
A <dfn>dimension</dfn> is a <<number>>
716-
immediately followed by a unit identifier.
724+
When written literally,
725+
a <dfn>dimension</dfn> is a <a>number</a>
726+
immediately followed by a unit identifier,
727+
which is an <a>identifier</a>.
717728
It corresponds to the <<dimension-token>> production
718729
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
719730
Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.
720731

721-
<p>CSS uses <a>dimensions</a> to specify
732+
CSS uses <<dimension>>s to specify
722733
distances (<<length>>),
723734
durations (<<time>>),
724735
frequencies (<<frequency>>),
@@ -1389,8 +1400,6 @@ Syntax</h4>
13891400
<dfn>&lt;calc-value></dfn> = <<number>> | <<dimension>> | <<percentage>> | ( <<calc-sum>> )
13901401
</pre>
13911402

1392-
<p noexport>Where a <dfn>&lt;dimension></dfn> is a <a>dimension</a>.
1393-
13941403
In addition, <a href="https://www.w3.org/TR/css-syntax/#whitespace">white space</a>
13951404
is required on both sides of the ''+'' and ''-'' operators.
13961405
(The ''*'' and ''/'' operaters can be used without white space around them.)

0 commit comments

Comments
 (0)