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
alt="[An image showing a box with a background shading gradually from white in the bottom-left corner to black in the top-right corner. There is a line, illustrating the gradient line, angled at 45 degrees and passing through the center of the box. The starting-point and ending-point of the gradient line are indicated by the intersection of the gradient line with two additional lines that pass through the bottom-left and top-right corners of the box.]"
1152
+
alt="[An image showing a box with a background shading gradually from white in the bottom-left corner to black in the top-right corner. There is a line, illustrating the gradient line, angled at 45 degrees and passing through the center of the box. The startingpoint and endingpoint of the gradient line are indicated by the intersection of the gradient line with two additional lines that pass through the bottom-left and top-right corners of the box.]"
<p>The first argument to the function specifies the <dfn>gradient line</dfn>,
582
582
which gives the gradient a direction and determines how color-stops are
583
-
positioned. It may be omitted; if so, it defaults to "to bottom".</p>
583
+
positioned. It may be omitted; if so, it defaults to ''to bottom''.</p>
584
584
585
585
<p>The <ititle="gradient line">gradient line's</i> direction may be specified in two ways:</p>
586
586
587
587
<dl>
588
-
<dt>by angle</dt>
589
-
<dd>For the purpose of this argument, 0deg points upward, and positive angles represent clockwise rotation, so 90deg point toward the right.</dd>
588
+
<dt>using angles</dt>
589
+
<dd>For the purpose of this argument, ''0deg'' points upward, and positive angles represent clockwise rotation, so ''90deg'' point toward the right.</dd>
590
590
591
-
<dt>by keyword</dt>
591
+
<dt>using keywords</dt>
592
592
<dd>
593
593
<p>If the argument is ''to top'', ''to right'', ''to bottom'', or ''to left'', the angle of the <i>gradient line</i> is ''0deg'', ''90deg'', ''180deg'', or ''270deg'', respectively.</p>
594
594
595
595
<p>If the argument instead specifies a corner of the box such as ''to top left'', the gradient line must be angled such that it points into the same quadrant as the specified corner, and a line drawn perpendicular to the <i>gradient line</i> through the center of the <i>gradient box</i> intersects the two neighboring corners.</p>
596
596
</dd>
597
597
</dl>
598
598
599
-
<p>Starting from the center of the <i>gradient box</i>, extend a line at the specified angle in both directions. The ending-point is the point on the <i>gradient line</i> where a line drawn perpendicular to the <i>gradient line</i> would intersect the corner of the <i>gradient box</i> in the specified direction. The starting-point is determined identically, but in the opposite direction.</p>
599
+
<p>Starting from the center of the <i>gradient box</i>, extend a line at the specified angle in both directions. The endingpoint is the point on the <i>gradient line</i> where a line drawn perpendicular to the <i>gradient line</i> would intersect the corner of the <i>gradient box</i> in the specified direction. The startingpoint is determined identically, but in the opposite direction.</p>
600
600
601
601
<pclass='note'>It is expected that the next level of this module will provide the ability to define the gradient's direction relative to the current text direction and writing-mode.</p>
602
602
603
603
<divclass=example>
604
604
<divstyle="overflow: hidden">
605
-
<imgstyle="float: right; margin-left: 1em;" src='gradient-diagram.png' alt="[An image showing a box with a background shading gradually from white in the bottom-left corner to black in the top-right corner. There is a line, illustrating the gradient line, angled at 45 degrees and passing through the center of the box. The starting-point and ending-point of the gradient line are indicated by the intersection of the gradient line with two additional lines that pass through the bottom-left and top-right corners of the box.]">
605
+
<imgstyle="float: right; margin-left: 1em;" src='gradient-diagram.png' alt="[An image showing a box with a background shading gradually from white in the bottom-left corner to black in the top-right corner. There is a line, illustrating the gradient line, angled at 45 degrees and passing through the center of the box. The startingpoint and endingpoint of the gradient line are indicated by the intersection of the gradient line with two additional lines that pass through the bottom-left and top-right corners of the box.]">
606
606
<p>This example illustrates visually how to calculate the
607
607
<i>gradient line</i> from the rules above. This shows the starting
608
-
and ending-point of the <i>gradient line</i>, along with the actual
608
+
and endingpoint of the <i>gradient line</i>, along with the actual
<p>Notice how, though the starting-point and ending-point are outside
611
+
<p>Notice how, though the startingpoint and endingpoint are outside
612
612
of the box, they're positioned precisely right so that the gradient
613
613
is pure white <em>exactly</em> at the corner, and pure black
614
614
<em>exactly</em> at the opposite corner. That's intentional, and
615
615
will always be true for linear gradients.</p>
616
616
</div>
617
617
</div>
618
618
619
-
<p>The gradient's color stops are typically placed between the starting-point
620
-
and ending-point on the <i>gradient line</i>, but this isn't required - the
621
-
<i>gradient line</i> extends infinitely in both directions. The starting-point
622
-
and ending-point are merely arbitrary location markers - the starting-point
619
+
<p>The gradient's color stops are typically placed between the starting point
620
+
and endingpoint on the <i>gradient line</i>, but this isn't required - the
621
+
<i>gradient line</i> extends infinitely in both directions. The starting point
622
+
and endingpoint are merely arbitrary location markers - the starting point
623
623
defines where 0%, 0px, etc are located when specifying color-stops, and
624
-
the ending-point defines where 100% is located. Color-stops are allowed
624
+
the endingpoint defines where 100% is located. Color-stops are allowed
625
625
to have positions before 0% or after 100%.</p>
626
626
627
-
<p>The color of the gradient at any point is determined by first finding the unique line passing through that point that is perpendicular to the <i>gradient line</i>. The point's color is then the color of the <i>gradient line</i> at the point where this line intersects it.</p>
627
+
<p>The color of the gradient at any point is determined by finding the unique line passing through that point that is perpendicular to the <i>gradient line</i>. The point's color is the color of the <i>gradient line</i> at the point where this line intersects it.</p>
0 commit comments