You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Color-stops are points placed along the line defined by the gradient-line at the beginning of the rule. Color-stops must be specified in order. Percentages refer to the length of the gradient-line, with 0% being at the starting point and 100% being at the ending point. Lengths are measured from the starting-point in the direction of the ending-point. Color-stops are usually placed between the starting-point and ending-point, but that's not required; the gradient-line extends infinitely in both directions, and a color-stop can be placed at any position on the line.</p>
412
412
<p>At each color-stop, the line is the color of the color-stop. Between two color-stops, the line's color is linearly interpolated between the colors of the two color-stops, with the interpolation taking place in premultiplied RGBA space. Before the first color-stop, the line is the color of the first color-stop. After the last color-stop, the line is the color of the last color-stop.</p>
413
413
<p>The following steps must be applied <em>in order</em> to process the list of color-stops. After applying these rules, all color-stops will have a definite position and they will be in ascending order:</p>
<li>If the first argument to the gradient function was not a color-stop, append a comma and a space ", " to s.</li>
797
-
<li>For each color-stop in the gradient, do the following:
798
-
<ol>
799
-
<li>Serialize the <color>, and append it to s.</li>
800
-
<li>If a <length> or <percentage> was specified, append a space " " to s, then serialize the <length> or <percentage> and append it to s.</li>
801
-
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
802
-
</ol>
803
-
</li>
797
+
<li>For each color-stop in the gradient, serialize the color-stop, and append it to s. Then, if it is not the final color-stop, append a comma and a space ", " to s.</li>
804
798
<li>Append a close parenthesis ")" to s.</li>
805
799
</ol>
806
-
<p>To serialize a radialgradient, let s initially be the empty string, run these steps, and then return s:</p>
800
+
<p>To serialize a ''<radial-gradient>'':</p>
807
801
<ol>
808
802
<li>Append "radial-gradient(" to s.</li>
809
803
<li>If a <bg-position> was specified in the first argument to the gradient function, serialize it and append it to s. Otherwise, append "center" to s.</li>
<li>For each color-stop in the gradient, do the following:
832
-
<ol>
833
-
<li>Serialize the <color>, and append it to s.</li>
834
-
<li>If a <length> or <percentage> was specified, append a space " " to s, then serialize the <length> or <percentage> and append it to s.</li>
835
-
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
836
-
</ol>
837
-
</li>
825
+
<li>For each color-stop in the gradient, serialize the color-stop, and append it to s. Then, if it is not the final color-stop, append a comma and a space ", " to s.</li>
838
826
<li>Append a close parenthesis ")" to s.</li>
839
827
</ol>
828
+
<p>To serialize a ''<color-stop>'':</p>
829
+
<ol>
830
+
<li>Serialize the <color>, and append it to s.</li>
831
+
<li>If a <length> or <percentage> was specified, append a space " " to s, then serialize the <length> or <percentage> and append it to s.</li>
0 commit comments