Skip to content

Commit b6529a4

Browse files
authored
[css-borders-4] Allowed single <length> value in 'box-shadow-offset' (#13146)
1 parent 38f4779 commit b6529a4

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

css-borders-4/Overview.bs

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,7 @@ Offsetting shadows: the 'box-shadow-offset' property</h3>
27272727

27282728
<pre class="propdef">
27292729
Name: box-shadow-offset
2730-
Value: [ none | <<length>>{2} ]#
2730+
Value: [ none | <<length>>{1,2} ]#
27312731
Initial: none
27322732
Applies to: all elements
27332733
Inherited: no
@@ -2742,8 +2742,11 @@ Offsetting shadows: the 'box-shadow-offset' property</h3>
27422742
<p>The 'box-shadow-offset' property defines one or more drop shadow offsets.
27432743
The property accepts a comma-separated list.
27442744
Each item in that list can either be the ''box-shadow-offset/none'' value,
2745-
which indicates no shadow, or a pair of horizontal and vertical offsets,
2746-
where both values are described as <<length>> values.
2745+
which indicates no shadow,
2746+
a pair of <<length>> values,
2747+
which define the horizontal and vertical offsets,
2748+
or a single <<length>> value,
2749+
which sets both offsets to the same value.
27472750

27482751
<dl dfn-type=value dfn-for=box-shadow-offset>
27492752
<dt><dfn id="shadow-offset-none">none</dfn>
@@ -2757,6 +2760,9 @@ Offsetting shadows: the 'box-shadow-offset' property</h3>
27572760
A positive value draws a shadow that is offset to the right of the box,
27582761
a negative length to the left.
27592762

2763+
If only one <<length>> value is specified,
2764+
it sets both the horizontal and vertical offsets to that value.
2765+
27602766
<dt><dfn id="shadow-offset-y">2nd <<length>></dfn>
27612767
<dd>
27622768
Specifies the <dfn>vertical offset</dfn> of the shadow.
@@ -2902,14 +2908,18 @@ Drop Shadows Shorthand: the 'box-shadow' property</h3>
29022908
ordered front to back.
29032909

29042910
<p>Each shadow is given as a <<spread-shadow>>,
2905-
outlining the 'box-shadow-offset', and optional values for the 'box-shadow-blur',
2911+
outlining the 'box-shadow-offset' defined by two <<length>> values, and optional values for the 'box-shadow-blur',
29062912
'box-shadow-spread', 'box-shadow-color', and 'box-shadow-position'.
29072913
Omitted lengths are ''0'';
29082914
omitted colors default to ''transparent'' when the specified offset is ''box-shadow-offset/none''
29092915
and to ''currentcolor'' otherwise.
29102916

2917+
Note: To avoid ambiguities in parsing the different <<length>> values,
2918+
the offset has to be specified as two <<length>> values, in opposite to the 'box-shadow-offset' property,
2919+
where a single <<length>> value can be used to specify both offsets.
2920+
29112921
<pre class=prod>
2912-
<dfn><<spread-shadow>></dfn> = <<'box-shadow-color'>>? &amp;&amp; [ <<'box-shadow-offset'>> [ <<'box-shadow-blur'>> <<'box-shadow-spread'>>? ]? ] &amp;&amp; <<'box-shadow-position'>>?</pre>
2922+
<dfn><<spread-shadow>></dfn> = <<'box-shadow-color'>>? &amp;&amp; [ [ none | <<length>>{2} ] [ <<'box-shadow-blur'>> <<'box-shadow-spread'>>? ]? ] &amp;&amp; <<'box-shadow-position'>>?</pre>
29132923

29142924
<div class="example">
29152925
The example below demonstrates the effects of spread and blur on the shadow:
@@ -3221,24 +3231,25 @@ Changes since the <a href="https://www.w3.org/TR/2025/WD-css-borders-4-20250722/
32213231
First Public Working Draft</a> of 22 July 2025
32223232
</h3>
32233233

3224-
* added 'corner-*' shorthands
3225-
* renamed <code>corners</code> to 'corner'
3234+
* Added 'corner-*' shorthands
3235+
* Renamed <code>corners</code> to 'corner'
32263236
* Added Web Platform Tests coverage
3227-
* incorporated full text of [[CSS3BG]] related to borders and shadows
3237+
* Incorporated full text of [[CSS3BG]] related to borders and shadows
32283238
* Renamed 'border-clip-*' properties to 'border-*-clip' and added logical longhands and shorthands
32293239
* Renamed <css>normal</css> value of 'border-*-clip' properties to ''border-top-clip/none''
32303240
* Added new syntax for 'border-*-*-radius' longhands using a slash to separate horizontal and vertical radii
3241+
* Allowed a single <<length>> value for 'box-shadow-offset' to set both offsets to the same value
32313242

32323243
<h3 class=no-num id="level-changes">
32333244
Additions since [[CSS3BG]]</h3>
32343245

32353246
* <<image-1D>> as value for 'border-color' and its longhands
3236-
* added physical and logical 'border-*-radius' shorthands
3237-
* added 'corner-shape' and 'corner-*-shape' shorthands, plus related 'corner' and 'corner-*' shorthands
3238-
* added 'border-shape'
3239-
* added <a href="#partial-borders">partial borders</a> via 'border-limit' and 'border-*-clip' properties
3240-
* added 'box-shadow-*' longhands and turned 'box-shadow' into a shorthand
3241-
* moved logical border properties from [[CSS-LOGICAL-1]] to this spec.
3247+
* Added physical and logical 'border-*-radius' shorthands
3248+
* Added 'corner-shape' and 'corner-*-shape' shorthands, plus related 'corner' and 'corner-*' shorthands
3249+
* Added 'border-shape'
3250+
* Added <a href="#partial-borders">partial borders</a> via 'border-limit' and 'border-*-clip' properties
3251+
* Added 'box-shadow-*' longhands and turned 'box-shadow' into a shorthand
3252+
* Moved logical border properties from [[CSS-LOGICAL-1]] to this spec.
32423253

32433254
<h2 class=no-num id="acknowledgments">
32443255
Acknowledgments</h2>

0 commit comments

Comments
 (0)