Skip to content

Commit a4e346c

Browse files
committed
[css-images-4] Switch color-stop grammar to repeat at end for readability. Add intro text and note talking about color stop lists.
1 parent 8937527 commit a4e346c

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

css-images-4/Overview.bs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,35 +1333,47 @@ Repeating Gradients: the ''repeating-linear-gradient()'', ''repeating-radial-gra
13331333
<h3 id='color-stop-syntax'>
13341334
Gradient Color-Stops</h3>
13351335

1336+
All gradients are specified by a list of color stops,
1337+
giving the color and position of each stop on the [=gradient line=],
1338+
according to the following grammar:
1339+
13361340
<pre class=prod>
13371341
<dfn>&lt;color-stop-list></dfn> =
1338-
[ <<linear-color-stop>> [, <<linear-color-hint>>]? ]# , <<linear-color-stop>>
1342+
<<linear-color-stop>> , [ [ <<linear-color-hint>> , ]? <<linear-color-stop>> ]#
13391343
<dfn>&lt;linear-color-stop></dfn> = <<color>> && <<color-stop-length>>?
13401344
<dfn>&lt;linear-color-hint></dfn> = <<length-percentage>>
13411345
<dfn>&lt;color-stop-length></dfn> = <<length-percentage>>{1,2}
13421346
13431347
<dfn>&lt;angular-color-stop-list></dfn> =
1344-
[ <<angular-color-stop>> [, <<angular-color-hint>>]? ]# , <<angular-color-stop>>
1348+
<<angular-color-stop>> , [ [ <<angular-color-hint>> , ]? <<angular-color-stop>> ]#
13451349
<dfn>&lt;angular-color-stop></dfn> = <<color>> && <<color-stop-angle>>?
13461350
<dfn>&lt;angular-color-hint></dfn> = <<angle-percentage>>
13471351
<dfn>&lt;color-stop-angle></dfn> = <<angle-percentage>>{1,2}
13481352
13491353
<dfn>&lt;color-stop></dfn> = <<color-stop-length>> | <<color-stop-angle>>
13501354
</pre>
13511355

1352-
<pre class='railroad'>
1353-
Plus:
1354-
Sequence:
1355-
N: <color-stop>
1356-
Choice: 1
1357-
Sequence:
1358-
T: ,
1359-
N: <color-hint>
1360-
Skip:
1356+
<div class=note>
1357+
Note that <<color-stop-list>> and <<angular-color-stop-list>> are exactly identical in structure,
1358+
they just differ on whether they accept <<length>>s or <<angle>>s
1359+
for specifying the position of the stops and hints.
1360+
1361+
Visualized with a railroad diagram,
1362+
both of them follow this pattern:
1363+
1364+
<pre class='railroad'>
1365+
N: <color-stop>
13611366
T: ,
1362-
T: ,
1363-
N: <color-stop>
1364-
</pre>
1367+
Plus:
1368+
Sequence:
1369+
Optional: skip
1370+
Sequence:
1371+
N: <color-hint>
1372+
T: ,
1373+
N: <color-stop>
1374+
T: ,
1375+
</pre>
1376+
</div>
13651377

13661378
<p class='issue'>
13671379
Are lengths useful in <<angular-color-stop>>, for a given gradient circle?

0 commit comments

Comments
 (0)