Skip to content

Commit 59e552a

Browse files
committed
[css-backgrounds-3] Handle negative spread radius of inner shadows. w3c#1900 (comment)
1 parent f7c3708 commit 59e552a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

css-backgrounds-3/Overview.bs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,8 @@ the margin is multiplied by the proportion 1 + (<var>r</var>-1)<sup>3</sup>,
19951995
where <var>r</var> is the ratio of the border radius to the margin,
19961996
in calculating the corner radii of the margin box shape.
19971997

1998+
1999+
19982000
<h3 id="corner-clipping">Corner Clipping</h3>
19992001

20002002
<p>Although <a href="#the-border-image">border images</a> are not affected
@@ -2921,8 +2923,10 @@ Shadow Shape, Spread, and Knockout</h4>
29212923
the <i>spread distance</i> (and flooring at zero).
29222924
However, in order to create a sharper corner when the border radius is small
29232925
(and thus ensure continuity between round and sharp corners),
2924-
when the <i>border radius</i> is less than the <i>spread distance</i>,
2925-
the <i>spread distance</i> of an outer shadow
2926+
when the <i>border radius</i> is less than the <i>spread distance</i>
2927+
(or in the case of an inner shadow,
2928+
less than the absolute value of a negative <i>spread distance</i>),
2929+
the <i>spread distance</i>
29262930
is multiplied by the proportion 1 + (<var>r</var>-1)<sup>3</sup>,
29272931
where <var>r</var> is the ratio of the border radius to the <i>spread distance</i>,
29282932
in calculating the corner radii of the spread shadow shape.
@@ -3057,8 +3061,8 @@ Changes since the 17 October 2017 Candidate Recommendation</h3>
30573061
<pre><<shadow>> = <del>inset</del><ins><<color>></ins>? &amp;&amp; <<length>>{2,4} &amp;&amp; <del><<color>></del><ins>inset</ins>?</pre>
30583062
</blockquote>
30593063
<li>
3060-
Spread radius adjustment is only applied to outer shadows (and positive margins)--
3061-
i.e. cases where the radius of curvature grows, rather than shrinks.
3064+
Spread radius adjustment is only applied to shadows and margins
3065+
where the radius of curvature grows, rather than shrinks.
30623066
(<a href="https://github.com/w3c/csswg-drafts/issues/1900">Issue 1900</a>)
30633067
<blockquote>
30643068
<p>To preserve the box's shape when spread is applied,
@@ -3067,8 +3071,10 @@ Changes since the 17 October 2017 Candidate Recommendation</h3>
30673071
the <i>spread distance</i> (and flooring at zero).
30683072
However, in order to create a sharper corner when the border radius is small
30693073
<ins>(and thus ensure continuity between round and sharp corners)</ins>,
3070-
when the <i>border radius</i> is less than the <i>spread distance</i>,
3071-
the <i>spread distance</i> <ins>of an outer shadow</ins>
3074+
when the <i>border radius</i> is less than the <i>spread distance</i>
3075+
<ins>(or in the case of an inner shadow,
3076+
less than the absolute value of a negative <i>spread distance</i>)</ins>,
3077+
the <i>spread distance</i>
30723078
is multiplied by the proportion 1 + (<var>r</var>-1)<sup>3</sup>,
30733079
where <var>r</var> is the ratio of the border radius to the <i>spread distance</i>,
30743080
in calculating the corner radii of the spread shadow shape.

0 commit comments

Comments
 (0)