Skip to content

Commit 03a9bea

Browse files
committed
Add the two-location variant to the <color-stop> syntax.
1 parent ba0c87c commit 03a9bea

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

css4-images/Overview.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,10 +2268,10 @@ <h3 id=color-stop-syntax><span class=secno>5.5. </span> Gradient
22682268
Color-Stops</h3>
22692269

22702270
<pre class=prod><dfn
2271-
id=color-stop-type>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]?</pre>
2271+
id=color-stop-type>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]{0,2}</pre>
22722272

22732273
<pre class=prod><dfn
2274-
id=angular-color-stop-type>&lt;angular-color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;angle> ]?</pre>
2274+
id=angular-color-stop-type>&lt;angular-color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;angle> ]{0,2}</pre>
22752275

22762276
<p> Color-stops are points placed along the <a
22772277
href="#gradient-line"><i>gradient line</i></a> defined by the gradient
@@ -2285,6 +2285,14 @@ <h3 id=color-stop-syntax><span class=secno>5.5. </span> Gradient
22852285
gradient line extends infinitely in both directions, and a color-stop can
22862286
be placed at any position on the line.
22872287

2288+
<p> A color-stop with two locations is exactly equivalent to specifying two
2289+
color-stops with the same color, one at each location, including how it
2290+
reacts to the clean-up steps below. <span class=note>Specifying two
2291+
locations makes it easier to create solid-color "stripes" in a gradient,
2292+
without having to repeat the color twice.</span>
2293+
2294+
<p class=issue> Make sure this is handled well in the serialization rules.
2295+
22882296
<p> At each color-stop, the line is the color of the color-stop. Between
22892297
two color-stops, the line's color is linearly interpolated between the
22902298
colors of the two color-stops, with the interpolation taking place in

css4-images/Overview.src.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,8 +1826,8 @@ <h3 id='repeating-gradients'>
18261826
<h3 id='color-stop-syntax'>
18271827
Gradient Color-Stops</h3>
18281828

1829-
<pre class=prod><dfn id='color-stop-type'>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]?</pre>
1830-
<pre class=prod><dfn id='angular-color-stop-type'>&lt;angular-color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;angle> ]?</pre>
1829+
<pre class=prod><dfn id='color-stop-type'>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]{0,2}</pre>
1830+
<pre class=prod><dfn id='angular-color-stop-type'>&lt;angular-color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;angle> ]{0,2}</pre>
18311831

18321832
<p>
18331833
Color-stops are points placed along the <i>gradient line</i>
@@ -1844,6 +1844,17 @@ <h3 id='color-stop-syntax'>
18441844
the gradient line extends infinitely in both directions,
18451845
and a color-stop can be placed at any position on the line.
18461846

1847+
<p>
1848+
A color-stop with two locations is exactly equivalent
1849+
to specifying two color-stops with the same color,
1850+
one at each location,
1851+
including how it reacts to the clean-up steps below.
1852+
<span class='note'>Specifying two locations makes it easier to create solid-color "stripes" in a gradient,
1853+
without having to repeat the color twice.</span>
1854+
1855+
<p class='issue'>
1856+
Make sure this is handled well in the serialization rules.
1857+
18471858
<p>
18481859
At each color-stop,
18491860
the line is the color of the color-stop.

0 commit comments

Comments
 (0)