Skip to content

Commit

Permalink
[css-images-4] Make radial-gradient() and <<basic-shape>> consistent. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Dec 18, 2023
1 parent f3c32dc commit 7d30833
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion css-images-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,10 @@ to bring them back into gamut.
Radial Gradients: the ''radial-gradient()'' notation {#radial-gradients}
------------------------------------------------------------------------


<h4 id="radial-color-interpolation">
Adding <<color-interpolation-method>></h4>

This level adds a <<color-interpolation-method>> argument
to ''radial-gradient()'' and ''repeating-radial-gradient()'',
indicating the color space and path to use
Expand All @@ -1345,7 +1349,7 @@ Radial Gradients: the ''radial-gradient()'' notation {#radial-gradients}

<pre class=prod>
<dfn>&lt;radial-gradient-syntax></dfn> =
[ [ [ <<rg-ending-shape>> || <<rg-size>> ]? [ at <<position>> ]? ] || <<color-interpolation-method>>]? ,
[ [ [ <<radial-shape>> || <<radial-size>> ]? [ at <<position>> ]? ] || <<color-interpolation-method>>]? ,
<<color-stop-list>>
</pre>

Expand All @@ -1372,6 +1376,26 @@ Radial Gradients: the ''radial-gradient()'' notation {#radial-gradients}
alt="red to green gradient in three colorspaces" >
</div>

<h4 id="radial-size">
Expanding <<radial-size>></h4>

This level extends the <<radial-size>> options
to include the additions from the ''circle()'' and ''ellipse()'' <<basic-shape>> values:

<pre class=prod>
<<radial-size>> = <<radial-extent>>{1,2} | <<length-percentage [0,∞]>>{1,2}
</pre>

Two-component values remain invalid when specifying
''radial-gradient()/circle'' as the <<radial-shape>>,
and otherwise indicate the horizontal (first) and vertical (second) radii
of the ellipse.

For ''radial-gradient()/circle'',
a <<percentage>> value is resolved against
the “scaled diagonal” of the [=gradient box=]'s width and height:
<code>sqrt(width² + height²)/sqrt(2)</code>.

<!--
██████ ███████ ██ ██ ████ ██████
██ ██ ██ ██ ███ ██ ██ ██ ██
Expand Down Expand Up @@ -2528,6 +2552,15 @@ Note: No change from [[css-images-3]].
Changes {#changes}
==================

<h3 class="no-num" id="changes-20230217">
Changes Since the <a href="https://www.w3.org/TR/2023/WD-css-images-4-20230217/">17 February 2023</a> Working Draft</h3>

* Added <<percentage>> values to ''radial-gradient(circle)'',
and dual <<radial-extent>> values to ''radial-gradient(ellipse)''
to make ''radial-gradient()'' consistent with
the ''circle()'' and ''ellipse()'' <<basic-shape>>s.
(<a href="https://github.com/w3c/csswg-drafts/issues/824">Issue 824</a>)

<h3 class="no-num" id="changes-20170413">
Changes Since the <a href="https://www.w3.org/TR/2017/WD-css-images-4-20170413/">13 April 2017</a> Working Draft</h3>

Expand Down

0 comments on commit 7d30833

Please sign in to comment.