Skip to content

Commit 8444e12

Browse files
authored
[css-borders-4] Added 'border-*-clip' shorthands (#13143)
Added the two shorthand properties 'border-block-clip' and 'border-inline-clip', split 'border-clip' out, added a "Logical property group" entry to the longhands definition, clarified their definition a bit and fixed the related examples.
1 parent 39ae73a commit 8444e12

File tree

1 file changed

+50
-26
lines changed

1 file changed

+50
-26
lines changed

css-borders-4/Overview.bs

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,9 +1239,9 @@ Corner Shaping: the 'corner-*-shape' properties</h3>
12391239
set the corner shape for the given corner.
12401240

12411241
The [=flow-relative=] longhands
1242-
('corner-start-start-shape', etc)
1242+
('corner-start-start-shape', etc.)
12431243
correspond to the [=physical=] longhands
1244-
('corner-top-left-shape', etc)
1244+
('corner-top-left-shape', etc.)
12451245
depending on the element’s 'writing-mode', 'direction', and 'text-orientation'.
12461246
The first <css>start</css>/<css>end</css> gives the block axis side,
12471247
and the second the inline-axis side
@@ -1350,18 +1350,18 @@ The 'corner-*-shape' shorthands:</h4>
13501350
Value: <<'corner-top-left-shape'>>{1,2}
13511351
</pre>
13521352

1353-
The 'corner-*-shape'/etc shorthands set the two 'corner-*-*-shape'
1353+
The 'corner-*-shape' shorthands set the two 'corner-*-*-shape'
13541354
properties of the related side.
13551355
If only one value is given,
13561356
the second value defaults to the same value.
13571357

1358-
For the physical shorthands ('corner-top-shape', etc),
1358+
For the physical shorthands ('corner-top-shape', etc.),
13591359
the values are either in left/right order, or top/bottom order,
13601360
whichever axis is meaningful for the property.
13611361
That is, ''corner-top-shape: round square''
13621362
sets ''corner-top-left-shape: round; corner-top-right-shape: square;''.
13631363

1364-
For the logical shorthands ('corner-block-start-shape', etc),
1364+
For the logical shorthands ('corner-block-start-shape', etc.),
13651365
the values are always in start/end order in the other axis.
13661366
That is, ''corner-block-start-shape: round square''
13671367
sets ''corner-start-start-shape: round; corner-start-end-shape: square;''.
@@ -2451,11 +2451,12 @@ Partial Borders: the 'border-limit' property</h3>
24512451
The 'border-clip' properties</h3>
24522452

24532453
<pre class="propdef">
2454-
Name: border-clip, border-top-clip, border-right-clip, border-bottom-clip, border-left-clip,
2454+
Name: border-top-clip, border-right-clip, border-bottom-clip, border-left-clip,
24552455
border-block-start-clip, border-block-end-clip, border-inline-start-clip, border-inline-end-clip
24562456
Value: normal | [ <<length-percentage [0,&infin;]>> | <<flex>> ]+
24572457
Initial: normal
24582458
Inherited: no
2459+
Logical property group: border-clip
24592460
Percentages: refer to length of border-edge side
24602461
Computed value: ''border-clip/normal'', or a list consisting of absolute lengths, or percentages as specified
24612462
Animation type: by computed value
@@ -2469,21 +2470,44 @@ The 'border-clip' properties</h3>
24692470
The ''border-clip/normal'' value means
24702471
that the border is not split, but shown normally.
24712472

2472-
<p>'border-clip' is a shorthand property for the four individual properties.
2473+
The [=flow-relative=] longhands
2474+
('border-block-start-clip', etc.)
2475+
correspond to the [=physical=] longhands
2476+
('border-top-clip', etc.)
2477+
depending on the element’s 'writing-mode', 'direction', and 'text-orientation'.
2478+
2479+
<pre class="propdef shorthand">
2480+
Name: border-block-clip, border-inline-clip
2481+
Value: <'border-top-clip'>
2482+
</pre>
2483+
2484+
These two [=shorthand properties=] set the
2485+
'border-block-start-clip' &amp; 'border-block-end-clip'
2486+
and
2487+
'border-inline-start-clip' &amp; 'border-inline-end-clip',
2488+
respectively.
2489+
2490+
<pre class="propdef shorthand">
2491+
Name: border-clip
2492+
Value: <'border-top-clip'>
2493+
</pre>
2494+
2495+
'border-clip' is a [=shorthand property=] for the longhand properties,
2496+
setting all four sides to the same value.
24732497

2474-
<p>If the listed parts are shorter than the border, any remaining
2498+
If the listed parts are shorter than the border, any remaining
24752499
border is split proportionally between the specified flexible lengths. If
24762500
there are no flexible lengths, the behavior is as if ''1fr'' had been
24772501
specified at the end of the list.
24782502

2479-
<p>If the listed parts are longer than the border, the specified parts
2503+
If the listed parts are longer than the border, the specified parts
24802504
will be shown in full until the end of the border. In this case, all
24812505
flexible lengths will be zero.
24822506

2483-
<p>For horizontal borders, parts are listed from left to right. For
2507+
For horizontal borders, parts are listed from left to right. For
24842508
vertical borders, parts are listed from top to bottom.
24852509

2486-
<p>The exact border parts are determined by laying out the specified border
2510+
The exact border parts are determined by laying out the specified border
24872511
parts with all flexible lengths initially set to zero. Any remaining border is
24882512
split proportionally between the flexible lengths specified.
24892513

@@ -2500,10 +2524,10 @@ The 'border-clip' properties</h3>
25002524

25012525
<div class="example">
25022526
<pre>
2503-
border-clip-top: 10px 1fr 10px;
2504-
border-clip-bottom: 10px 1fr 10px;
2505-
border-clip-right: 5px 1fr 5px;
2506-
border-clip-left: 5px 1fr 5px;
2527+
border-top-clip: 10px 1fr 10px;
2528+
border-bottom-clip: 10px 1fr 10px;
2529+
border-right-clip: 5px 1fr 5px;
2530+
border-left-clip: 5px 1fr 5px;
25072531
</pre>
25082532
<div style="position: relative; width: 250px; height: 150px; background: white;">
25092533
<div style="border: 2px solid black; width: 200px; height: 100px; position: absolute; top: 20px; left: 20px">
@@ -2518,10 +2542,10 @@ The 'border-clip' properties</h3>
25182542
the previous example can easily be created:
25192543

25202544
<pre>
2521-
border-clip-top: 0 10px 1fr 10px;
2522-
border-clip-bottom: 0 10px 1fr 10px;
2523-
border-clip-right: 0 5px 1fr 5px;
2524-
border-clip-left: 0 5px 1fr 5px;
2545+
border-top-clip: 0 10px 1fr 10px;
2546+
border-bottom-clip: 0 10px 1fr 10px;
2547+
border-right-clip: 0 5px 1fr 5px;
2548+
border-left-clip: 0 5px 1fr 5px;
25252549
</pre>
25262550

25272551
<div style="position: relative; width: 250px; height: 150px; background: white;">
@@ -2538,8 +2562,8 @@ The 'border-clip' properties</h3>
25382562
<pre>
25392563
border: thin solid black;
25402564
border-clip: 0 1fr; /* hide borders */
2541-
border-clip-top: 10px 1fr 10px; /* make certain borders visible */
2542-
border-clip-bottom: 10px 1fr 10px;
2565+
border-top-clip: 10px 1fr 10px; /* make certain borders visible */
2566+
border-bottom-clip: 10px 1fr 10px;
25432567
</pre>
25442568

25452569
<div style="position: relative; width: 250px; height: 150px; background: white;">
@@ -2554,8 +2578,8 @@ The 'border-clip' properties</h3>
25542578
<pre>
25552579
border-top: thin solid black;
25562580
border-bottom: thin solid black;
2557-
border-clip-top: 10px;
2558-
border-clip-bottom: 10px;
2581+
border-top-clip: 10px;
2582+
border-bottom-clip: 10px;
25592583
</pre>
25602584

25612585
<div style="position: relative; width: 250px; height: 150px; background: white;">
@@ -2602,7 +2626,7 @@ The 'border-clip' properties</h3>
26022626
<div class="example">
26032627
<pre>
26042628
border: 4px solid black;
2605-
border-clip-top: 40px 20px 0 1fr 20px 20px 0 1fr 40px;
2629+
border-top-clip: 40px 20px 0 1fr 20px 20px 0 1fr 40px;
26062630
</pre>
26072631
<p>In this example, there will be a visible 40px border part on each end of the top border. Inside the 40px border parts, there will be an invisible border part of at least 20px. Inside these invisible border parts, there will be visible border parts, each 20px long with 20px invisible border parts between them.
26082632
<div style="position: relative; width: 192px; background: white; padding: 40px">
@@ -2619,7 +2643,7 @@ The 'border-clip' properties</h3>
26192643
<div class="example">
26202644
<pre>
26212645
border: 4px solid black;
2622-
border-clip-top: 3fr 10px 2fr 10px 1fr 10px 10px 10px 1fr 10px 2fr 10px 3fr;
2646+
border-top-clip: 3fr 10px 2fr 10px 1fr 10px 10px 10px 1fr 10px 2fr 10px 3fr;
26232647
</pre>
26242648

26252649
<p>All but one of the visible border parts are represented as flexible lengths in this example. The length of these border parts will change when the width of the element changes. Here is one rendering where 1fr ends up being 10px:
@@ -3201,7 +3225,7 @@ First Public Working Draft</a> of 22 July 2025
32013225
* renamed <code>corners</code> to 'corner'
32023226
* Added Web Platform Tests coverage
32033227
* incorporated full text of [[CSS3BG]] related to borders and shadows
3204-
* Renamed 'border-clip-*' properties to 'border-*-clip' and added logical longhands
3228+
* Renamed 'border-clip-*' properties to 'border-*-clip' and added logical longhands and shorthands
32053229
* Added new syntax for 'border-*-*-radius' longhands using a slash to separate horizontal and vertical radii
32063230

32073231
<h3 class=no-num id="level-changes">

0 commit comments

Comments
 (0)